[Bug c++/124412] different and confusing diagnostic order for = 0 / = 0u inside class vs at namespace scope

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Mar 9 12:34:54 GMT 2026


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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I'm far more concerned about the fact that "error: initializer specified for
non-virtual method 'void A::h()'" talks about an "initializer" instead of a
pure specifier, and talks about a "method" instead of a member function.

And saying "invalid pure specifier" for a non-member function isn't helpful,
the problem is not that 0u is invalid, the problem is that any pure specifier
on a non-member function is invalid.


More information about the Gcc-bugs mailing list