diff --git a/compilerplugins/clang/reducevarscope.cxx b/compilerplugins/clang/reducevarscope.cxx index be7254a2d569..76eece2131bb 100644 --- a/compilerplugins/clang/reducevarscope.cxx +++ b/compilerplugins/clang/reducevarscope.cxx @@ -537,7 +537,7 @@ bool ReduceVarScope::VisitLambdaExpr(const LambdaExpr* lambdaExpr) const LambdaCapture& capture = *captureIt; if (capture.capturesVariable()) { - auto varDecl = capture.getCapturedVar(); + auto varDecl = cast(capture.getCapturedVar()); maVarDeclMap.erase(varDecl); maVarUseSourceRangeMap.erase(varDecl); }