Issue |
126392
|
Summary |
[Clang] Accepts invalid lambda init-capture shadowing a template parameter
|
Labels |
clang
|
Assignees |
|
Reporter |
MagentaTreehouse
|
In the following code, the init-capture of the lambda has the same name as the NTTP `i`, which should not be allowed.
```c++
template <int i>
int f() {
return [i = 0] { return i; }();
}
int i = f<0>();
```
This is diagnosed by GCC and EDG.
See https://compiler-explorer.com/z/oh7MhabG9.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs