// Check if type is a C++ class with non-trivial destructor.
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);
- Scope->addVar(VD);
- ScopePos = Scope->begin();
+ if (!CD->hasTrivialDestructor()) {
+ // Add the variable to scope
+ Scope = createOrReuseLocalScope(Scope);
+ Scope->addVar(VD);
+ ScopePos = Scope->begin();
+ }
return Scope;
}