https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118447
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Blocks| |94404 Last reconfirmed| |2025-01-13 Alias| |cwg2346 Status|UNCONFIRMED |NEW --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed. In summary, the defect report changed: A local variable shall not appear as a potentially-evaluated expression in a default argument. To: [Note 4: A local variable cannot be odr-used ([basic.def.odr]) in a default argument. — end note] So before the Defect report, GCC/EDG is correct. And it was accepted only in 2018. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94404 [Bug 94404] [meta-bug] C++ core issues