https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106864
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Unexpected capture of |Const int captured could be
|"constexpr int" variable |avoid even if used by
|inside lambda |nested lambda
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Keywords|rejects-valid |c++-lambda
Last reconfirmed| |2025-01-06
Severity|normal |enhancement
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Yes this is just a missed optimization.