[Bug c++/118447] Local scope constant is not permitted as function's default argument

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jan 13 17:26:01 GMT 2025


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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
EDG also rejects it:
"<source>", line 6: error: reference to local variable of enclosing function is
not allowed
      void f(int = c);
                   ^


More information about the Gcc-bugs mailing list