Kaydet (Commit) 92db2f17 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Adapt loplugin:passstuffbyref to Clang 3.2

Change-Id: I24d0b7531feba32f86f761daf18170397cfe5d2f
üst 081f3c0f
......@@ -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();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment