PR19249: Don't forget to DiagnoseUseOfDecl for the implicit use of a variable
in a lambda capture. llvm-svn: 204757
This commit is contained in:
parent
afcbdb1570
commit
d7b2a9ebd1
|
@ -1062,6 +1062,8 @@ void Sema::ActOnStartOfLambdaDefinition(LambdaIntroducer &Intro,
|
|||
}
|
||||
|
||||
Var = R.getAsSingle<VarDecl>();
|
||||
if (Var && DiagnoseUseOfDecl(Var, C->Loc))
|
||||
continue;
|
||||
}
|
||||
|
||||
// C++11 [expr.prim.lambda]p8:
|
||||
|
|
|
@ -359,3 +359,7 @@ namespace PR18473 {
|
|||
};
|
||||
template void f<NoCopy>(); // expected-note {{instantiation}}
|
||||
}
|
||||
|
||||
void PR19249() {
|
||||
auto x = [&x]{}; // expected-error {{cannot appear in its own init}}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue