we're capturing it by value in a non-mutable lambda.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150791
91177308-0d34-0410-b5e6-
96231b3b80d8
return false;
if (isa<BlockScopeInfo>(CSI))
return true;
- if (LambdaScopeInfo *LSI = dyn_cast<LambdaScopeInfo>(CSI))
- return !LSI->Mutable;
+ if (LambdaScopeInfo *LSI = dyn_cast<LambdaScopeInfo>(CSI)) {
+ if (LSI->isCaptured(VD))
+ return LSI->getCapture(VD).isCopyCapture() && !LSI->Mutable;
+
+ return LSI->ImpCaptureStyle == LambdaScopeInfo::ImpCap_LambdaByval &&
+ !LSI->Mutable;
+ }
return false;
}
"should be const float&");
}();
}();
+
+ [&i] {
+ static_assert(is_same<decltype((i)), int&>::value, "should be int&");
+ }();
}