]> granicus.if.org Git - clang/commit
Fix an assertion failure trying to emit a trivial destructor in ObjC++
authorBen Langmuir <blangmuir@apple.com>
Fri, 26 Sep 2014 15:27:29 +0000 (15:27 +0000)
committerBen Langmuir <blangmuir@apple.com>
Fri, 26 Sep 2014 15:27:29 +0000 (15:27 +0000)
commitfdd013e6e3a82cb04d2682ca608c10f1a0241b84
tree08e147f2eddfa7e60a4eccfde14b13f7faa8e8a8
parent7c3d5fc873c4092fa7cbc96f658deb09ea215eac
Fix an assertion failure trying to emit a trivial destructor in ObjC++

If a base class declares a destructor, we will add the implicit
destructor for the subclass in
ActOnFields -> AddImplicitlyDeclaredMembersToClass

But in Objective C++, we did not compute whether we have a trivial
destructor until after that in
CXXRecordDecl::completeDefinition()

This was leading to a mismatch between the class, which thought it had
no trivial destructor, and the CXXDestructorDecl, which considered
itself trivial. It turns out the reason we delayed setting this until
completeDefinition() was for a warning that has since been removed as
part of -Warc-abi, so we just do it eagerly now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218520 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/DeclCXX.cpp
test/CodeGenObjCXX/destroy.mm [new file with mode: 0644]