return FailDistance;
const unsigned IndexOfCaptureReadyLambda = OptionalStackIndex.getValue();
- assert(
- ((IndexOfCaptureReadyLambda != (FunctionScopes.size() - 1)) ||
- (S.getCurGenericLambda() && S.getCurGenericLambda()->ImpCaptureStyle !=
- sema::LambdaScopeInfo::ImpCap_None)) &&
- "The capture ready lambda for a potential capture can only be the "
- "current lambda if it is a generic lambda with an implicit capture");
+ assert(((IndexOfCaptureReadyLambda != (FunctionScopes.size() - 1)) ||
+ S.getCurGenericLambda()) &&
+ "The capture ready lambda for a potential capture can only be the "
+ "current lambda if it is a generic lambda with an implicit capture");
const sema::LambdaScopeInfo *const CaptureReadyLambdaLSI =
cast<sema::LambdaScopeInfo>(FunctionScopes[IndexOfCaptureReadyLambda]);
void h(int i, char c) { g(i, c); } //expected-note{{in instantiation}}
}
+namespace simple_init_captures {
+ void test() {
+ int i;
+ auto L = [i](auto a) { return i + a; };
+ L(3.14);
+ }
+}
namespace odr_use_within_init_capture {
int test() {
-
+
{ // no captures
const int x = 10;
auto L = [z = x + 2](int a) {