[clang] [Sema] Instantiate destructors for initialized anonymous union fields (PR #128866)
Eli Friedman via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 28 13:07:21 PST 2025
================
@@ -5451,10 +5451,31 @@ bool Sema::SetCtorInitializers(CXXConstructorDecl *Constructor, bool AnyErrors,
NumInitializers * sizeof(CXXCtorInitializer*));
Constructor->setCtorInitializers(baseOrMemberInitializers);
+ SourceLocation Location = Constructor->getLocation();
+
+ for (CXXCtorInitializer *Initializer : Info.AllToInit) {
----------------
efriedma-quic wrote:
Instead of trying to detect the specific fields not handled by MarkBaseAndMemberDestructorsReferenced, I think it would be more straightforward to split MarkBaseDestructorsReferenced and MarkMemberDestructorsReferenced into separate functions, and just don't call MarkMemberDestructorsReferenced from here.
https://github.com/llvm/llvm-project/pull/128866
More information about the cfe-commits
mailing list