loplugin:stringconstant: Adapt to definition of OSL_THIS_FUNC on Windows

Change-Id: I93a23799ad9a76ed9f4f86d69adb610d0962da20
This commit is contained in:
Stephan Bergmann
2016-12-18 14:13:18 +01:00
parent 9ed9ca611a
commit 83ff2a4f38

View File

@@ -687,6 +687,17 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) {
{
return true;
}
// OSL_THIS_FUNC may be defined as "" or as something other
// than a string literal in include/osl/diagnose.h:
auto loc = arg->getLocStart();
if (compiler.getSourceManager().isMacroBodyExpansion(loc)
&& (Lexer::getImmediateMacroName(
loc, compiler.getSourceManager(),
compiler.getLangOpts())
== "OSL_THIS_FUNC"))
{
return true;
}
if (non) {
report(
DiagnosticsEngine::Warning,