diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-02-09 10:40:07 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-02-09 10:40:19 +0100 |
commit | 92db2f17b37660fd4edd8267a107d5491787dfad (patch) | |
tree | 9129681fb520e2eef8c2484b6f84232ebb896989 /compilerplugins | |
parent | 081f3c0f70a9aa4d9f1f72bfbdb838bbd2dc993e (diff) |
Adapt loplugin:passstuffbyref to Clang 3.2
Change-Id: I24d0b7531feba32f86f761daf18170397cfe5d2f
Diffstat (limited to 'compilerplugins')
-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(); } } |