loplugin:externvar (clang-cl)

Change-Id: I638199f1455bead71f0a03f15e4b6f418a0cd0e2
This commit is contained in:
Stephan Bergmann
2017-01-11 13:40:15 +01:00
parent 2597a2f1ad
commit 6ec5717e06
3 changed files with 23 additions and 14 deletions

View File

@@ -8,6 +8,7 @@
*/
#include "check.hxx"
#include "compat.hxx"
#include "plugin.hxx"
// Find variable declarations at namespace scope that need not have external
@@ -72,6 +73,14 @@ public:
// not needed and will not be emitted"
return true;
}
SourceLocation argLoc;
if (compat::isMacroArgExpansion(compiler, def->getLocation(), &argLoc)
&& (Lexer::getImmediateMacroName(
argLoc, compiler.getSourceManager(), compiler.getLangOpts())
== "DEFINE_GUID"))
{
return true;
}
report(
DiagnosticsEngine::Warning,
"variable with external linkage not declared in an include file",