Kaydet (Commit) 35196c32 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:vclwidgets: Adapt check for 'assert' for MSVCRT

Change-Id: I12a77b5b53e3a674c1ff1554b560a71605e141a6
üst 83ff2a4f
......@@ -216,10 +216,18 @@ bool VCLWidgets::VisitCXXDestructorDecl(const CXXDestructorDecl* pCXXDestructorD
}
}
}
// checking for ParenExpr is a hacky way to ignore assert statements in older versions of clang (i.e. <= 3.2)
if (!pCallExpr && !dyn_cast<ParenExpr>(*i))
if (!pCallExpr) {
auto loc = (*i)->getLocStart();
if (!compiler.getSourceManager().isMacroBodyExpansion(loc)
|| (Lexer::getImmediateMacroName(
loc, compiler.getSourceManager(),
compiler.getLangOpts())
!= "assert"))
{
nNumExtraStatements++;
}
}
}
bOk = bFoundDisposeOnce && nNumExtraStatements == 0;
}
if (!bOk) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment