[Bug c++/106552] GCC accepts invalid redefinition of captured variable inside lambda

2022-08-08 Thread jlame646 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106552 --- Comment #3 from Jason Liam --- Yes, msvc also accepts this but msvc also emits a diagnostic with the flag *std:c++20 /W4 .* On Mon, 8 Aug 2022, 22:03 pinskia at gcc dot gnu.org, < gcc-bugzi...@gcc.gnu.org> wrote: > https://gcc.gnu.org/bugz

[Bug c++/106552] GCC accepts invalid redefinition of captured variable inside lambda

2022-08-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106552 --- Comment #2 from Andrew Pinski --- expr.prim.lambda.capture/6 seems to imply this is invalid code. But the example is only with the parameter rather than a local variable ...

[Bug c++/106552] GCC accepts invalid redefinition of captured variable inside lambda

2022-08-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106552 --- Comment #1 from Andrew Pinski --- clang is the only compiler I tried which rejects this ... ICC, MSVC all accept this code.