compilerplugins/clang/stringconstant.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
New commits: commit 1a6f599e9883eb2c2f51788ebc1de3465e0c31cd Author: Stephan Bergmann <sberg...@redhat.com> Date: Tue Jun 28 09:06:46 2016 +0200 loplugin:stringconstant: Don't warn about "OUString(OSL_THIS_FUNC)" Change-Id: Id5f021bd798cb94b7246faed539304dae04b4700 diff --git a/compilerplugins/clang/stringconstant.cxx b/compilerplugins/clang/stringconstant.cxx index c68d58f..3b16d82 100644 --- a/compilerplugins/clang/stringconstant.cxx +++ b/compilerplugins/clang/stringconstant.cxx @@ -775,6 +775,21 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) { return true; } } + auto loc = expr->getArg(0)->getLocStart(); + while (compiler.getSourceManager() + .isMacroArgExpansion(loc)) + { + loc = compiler.getSourceManager() + .getImmediateMacroCallerLoc(loc); + } + if (compat::isMacroBodyExpansion(compiler, loc) + && (Lexer::getImmediateMacroName( + loc, compiler.getSourceManager(), + compiler.getLangOpts()) + == "OSL_THIS_FUNC")) + { + return true; + } report( DiagnosticsEngine::Warning, ("elide construction of " + qname + " with " _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits