================ @@ -5451,10 +5451,23 @@ bool Sema::SetCtorInitializers(CXXConstructorDecl *Constructor, bool AnyErrors, NumInitializers * sizeof(CXXCtorInitializer*)); Constructor->setCtorInitializers(baseOrMemberInitializers); + SourceLocation Location = Constructor->getLocation(); + + for (CXXCtorInitializer *Initializer : Info.AllToInit) { + FieldDecl *Field = Initializer->getAnyMember(); + if (!Field) + continue; + + RecordDecl *FieldRecordDecl = Field->getParent(); + if (!FieldRecordDecl->isUnion() || ---------------- momo5502 wrote:
Both examples should work now. Let's hope all other tests still pass :D The first example throws an additional error in gcc: ``` member 'VSX<int> VS::<unnamed union>::<unnamed struct>::_Tail' with destructor not allowed in anonymous aggregate ``` this error is not thrown by clang. should it though? If so, I don't think implementing that makes sense within the scope of this PR. However, is it ok that I still added the sample as a test case, even though technically the behaviour clang yields for this test is not 100% correct? https://github.com/llvm/llvm-project/pull/128866 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits