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-bugzi...@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.