diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-01-24 04:29:31 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-01-24 04:29:31 +0000 |
commit | afc6824fa6a8038bd11819deee0cc13a718b5ff4 (patch) | |
tree | 5410f64d7bf1589610ffdfb8d8a39fc516efc4f2 /clang/lib/Analysis/CFG.cpp | |
parent | 13ab2a417d8394cc0180ad5805e46ec935e65c06 (diff) | |
download | bcm5719-llvm-afc6824fa6a8038bd11819deee0cc13a718b5ff4.tar.gz bcm5719-llvm-afc6824fa6a8038bd11819deee0cc13a718b5ff4.zip |
More fixes/tests.
llvm-svn: 148777
Diffstat (limited to 'clang/lib/Analysis/CFG.cpp')
-rw-r--r-- | clang/lib/Analysis/CFG.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp index c760d49899d..c7040fc6d45 100644 --- a/clang/lib/Analysis/CFG.cpp +++ b/clang/lib/Analysis/CFG.cpp @@ -721,7 +721,7 @@ void CFGBuilder::addAutomaticObjDtors(LocalScope::const_iterator B, } const CXXDestructorDecl *Dtor = Ty->getAsCXXRecordDecl()->getDestructor(); - if (cast<FunctionType>(Dtor->getType())->getNoReturnAttr()) + if (Dtor && cast<FunctionType>(Dtor->getType())->getNoReturnAttr()) Block = createNoReturnBlock(); else autoCreateBlock(); @@ -864,7 +864,7 @@ LocalScope* CFGBuilder::addLocalScopeForVarDecl(VarDecl *VD, // Check if type is a C++ class with non-trivial destructor. if (const CXXRecordDecl *CD = QT->getAsCXXRecordDecl()) - if (!CD->hasTrivialDestructor()) { + if (CD->hasDefinition() && !CD->hasTrivialDestructor()) { // Add the variable to scope Scope = createOrReuseLocalScope(Scope); Scope->addVar(VD); |