diff options
Diffstat (limited to 'compilerplugins/clang/passstuffbyref.cxx')
-rw-r--r-- | compilerplugins/clang/passstuffbyref.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compilerplugins/clang/passstuffbyref.cxx b/compilerplugins/clang/passstuffbyref.cxx index 5617650579a1..9eb076884805 100644 --- a/compilerplugins/clang/passstuffbyref.cxx +++ b/compilerplugins/clang/passstuffbyref.cxx @@ -77,16 +77,16 @@ bool PassStuffByRef::VisitLambdaExpr(const LambdaExpr * expr) { if (ignoreLocation(expr)) { return true; } - for (auto const & i: expr->captures()) { - if (i.getCaptureKind() == LambdaCaptureKind::LCK_ByCopy) { + for (auto i(expr->capture_begin()); i != expr->capture_end(); ++i) { + if (i->getCaptureKind() == LambdaCaptureKind::LCK_ByCopy) { std::string name; - if (isFat(i.getCapturedVar()->getType(), &name)) { + if (isFat(i->getCapturedVar()->getType(), &name)) { report( DiagnosticsEngine::Warning, ("%0 capture of '%1' variable by copy, rather use capture" " by reference---UNLESS THE LAMBDA OUTLIVES THE VARIABLE"), - i.getLocation()) - << (i.isImplicit() ? "implicit" : "explicit") << name + i->getLocation()) + << (i->isImplicit() ? "implicit" : "explicit") << name << expr->getSourceRange(); } } |