REPOSITORY
  rL LLVM

================
Comment at: cfe/trunk/lib/CodeGen/CGClass.cpp:1345
@@ -1344,3 +1348,3 @@
   CXXRecordDecl *FieldClassDecl = cast<CXXRecordDecl>(RT->getDecl());
   return HasTrivialDestructorBody(Context, FieldClassDecl, FieldClassDecl);
 }
----------------
The right place to fix this is here. The corresponding code from Sema is:

    // The destructor for an implicit anonymous union member is never invoked.
    if (FieldClassDecl->isUnion() && FieldClassDecl->isAnonymousStructOrUnion())
      continue;

Since the AST doesn't explicitly list the field destructor class that a 
destructor will perform, we need to mirror that check here. (Alternatively, we 
could change Sema to declare a trivial destructor for an anonymous union 
member, but that seems a little wasteful.)

http://reviews.llvm.org/D10508

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to