<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 4, 2018, at 8:29 PM, David Zarzycki <<a href="mailto:dave@znu.io" class="">dave@znu.io</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi Adrian,<br class=""><br class="">Feel free to file a bug if you’re motivated. Personally speaking, I don’t expect this bug to be on anybody’s priority list. The workaround of using named structs/unions has no downside for most projects, and Swift is no exception.<br class=""></div></div></blockquote><div><br class=""></div>Filed as <a href="https://bugs.llvm.org/show_bug.cgi?id=35832" class="">https://bugs.llvm.org/show_bug.cgi?id=35832</a></div><div><br class=""></div><div>John.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">Dave<br class=""><br class="">-- <br class="">Sent from my iPad<br class=""><br class=""><blockquote type="cite" class="">On Jan 4, 2018, at 20:11, Adrian Prantl <<a href="mailto:aprantl@apple.com" class="">aprantl@apple.com</a>> wrote:<br class=""><br class=""><br class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">On Dec 16, 2017, at 10:31 AM, John McCall via swift-dev <<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>> wrote:<br class=""><br class=""><br class="">On Dec 16, 2017, at 9:08 AM, David Zarzycki via swift-dev <<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>> wrote:<br class=""><br class="">Hello,<br class=""><br class="">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:<br class=""><br class="">class B {<br class="">protected:<br class=""> int i;<br class=""> union { int j; };<br class="">};<br class=""><br class="">class X : public B { };<br class="">class Y : public B { };<br class=""><br class="">class Z : public X, public Y {<br class=""> int a() { return X::i; } // works<br class=""> int b() { return X::j; } // fails<br class="">};<br class=""><br class="">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.<br class=""></blockquote><br class="">This seems like a bug; anonymous unions are just supposed to inject their member names into the containing scope as if there was an ordinary member there, and the explicit scope-qualification should resolve which subobject is meant for such injected names the same it resolves them for ordinary fields. But if it's a bug in all existing clangs, it's a bug we're going to have to work around.<br class=""></blockquote><br class="">Which should not prevent Dave from still reporting it on <a href="https://bugs.llvm.org/enter_bug.cgi?product=clang" class="">https://bugs.llvm.org/enter_bug.cgi?product=clang</a> :-)<br class=""><br class="">-- adrian<br class=""></blockquote><br class=""></div></div></blockquote></div><br class=""></body></html>