You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
voidf() {
auto h = [y = 0]<typename y>(y) { return0; };
}
clang should diagnose this since it is ill-formed, we can see this from expr.prim.lambda.capture p5 which says:
If an identifier in a capture appears as the declarator-id of a parameter of the lambda-declarator's parameter-declaration-clause or as the name of a template parameter of the lambda-expression's template-parameter-list, the program is ill-formed.
and also has the following example:
voidf() {
int x = 0;
auto g = [x](int x) { return0; }; // error: parameter and [capture](https://eel.is/c++draft/expr.prim.lambda#nt:capture) have the same nameauto h = [y = 0]<typename y>(y) { return0; }; // error: template parameter and [capture](https://eel.is/c++draft/expr.prim.lambda#nt:capture)// have the same name
}