Hello,

I’m trying to improve SILNode memory layout density by adopting the AST 
bitfield macros. Unfortunately, multiple inheritance doesn’t seem to get along 
with anonymous/unnamed unions. Here is a distillation of the problem:

class B {
protected:
    int i;
    union { int j; };
};

class X : public B { };
class Y : public B { };

class Z : public X, public Y {
    int a() { return X::i; } // works
    int b() { return X::j; } // fails
};

Is this expected C++ behavior? I can certainly workaround this by naming the 
unnamed union, but before I do, I thought that I should check here first.

Thanks,
Dave
_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

Reply via email to