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

jlame646 at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Aug 8 19:28:39 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106552

--- Comment #3 from Jason Liam <jlame646 at gmail dot com> ---
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-bugzilla@gcc.gnu.org> wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106552
>
> --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
> 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 ...
>
> --
> You are receiving this mail because:
> You reported the bug.


More information about the Gcc-bugs mailing list