summaryrefslogtreecommitdiffstats
path: root/compilerplugins/clang/reducevarscope.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/reducevarscope.cxx')
-rw-r--r--compilerplugins/clang/reducevarscope.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/compilerplugins/clang/reducevarscope.cxx b/compilerplugins/clang/reducevarscope.cxx
index c293fd432e6a..76eece2131bb 100644
--- a/compilerplugins/clang/reducevarscope.cxx
+++ b/compilerplugins/clang/reducevarscope.cxx
@@ -18,6 +18,7 @@
#include "plugin.hxx"
#include "check.hxx"
+#include "config_clang.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/StmtVisitor.h"
@@ -392,7 +393,7 @@ bool ReduceVarScope::VisitVarDecl(const VarDecl* varDecl)
if (!compiler.getSourceManager().isInMainFile(varDecl->getLocation()))
return true;
// Ignore macros like FD_ZERO
- if (compiler.getSourceManager().isMacroBodyExpansion(compat::getBeginLoc(varDecl)))
+ if (compiler.getSourceManager().isMacroBodyExpansion(varDecl->getBeginLoc()))
return true;
if (varDecl->hasGlobalStorage())
return true;
@@ -536,7 +537,7 @@ bool ReduceVarScope::VisitLambdaExpr(const LambdaExpr* lambdaExpr)
const LambdaCapture& capture = *captureIt;
if (capture.capturesVariable())
{
- auto varDecl = capture.getCapturedVar();
+ auto varDecl = cast<VarDecl>(capture.getCapturedVar());
maVarDeclMap.erase(varDecl);
maVarUseSourceRangeMap.erase(varDecl);
}