forked from OSchip/llvm-project
Fixed checking for trivial destructor in CFGBuilder::addLocalScopeForVarDecl. Checked type does not have to represent C++ class.
llvm-svn: 115254
This commit is contained in:
parent
ef1fb2d1d1
commit
e84cb97997
|
@ -564,9 +564,10 @@ LocalScope* CFGBuilder::addLocalScopeForVarDecl(VarDecl* VD,
|
|||
}
|
||||
|
||||
// Check if type is a C++ class with non-trivial destructor.
|
||||
const RecordType* RT = QT.getTypePtr()->getAs<RecordType>();
|
||||
if (!RT || cast<CXXRecordDecl>(RT->getDecl())->hasTrivialDestructor())
|
||||
return Scope;
|
||||
if (const RecordType* RT = QT.getTypePtr()->getAs<RecordType>())
|
||||
if (const CXXRecordDecl* CD = dyn_cast<CXXRecordDecl>(RT->getDecl()))
|
||||
if (CD->hasTrivialDestructor())
|
||||
return Scope;
|
||||
|
||||
// Add the variable to scope
|
||||
Scope = createOrReuseLocalScope(Scope);
|
||||
|
|
Loading…
Reference in New Issue