[Bug c++/86464] Delegating constructor causes error if parameter has same name as class
egallager at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Dec 15 03:25:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86464
--- Comment #2 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #1)
> EDG accepts it but Clang also rejects it:
>
> del.cc:5:11: error: member initializer 'foo' does not name a non-static data
> member or base class
> : foo{ foo }
> ^~~~~~~~~~
>
> But I think the code is valid according to [class.base.init] p2.
Even if it's valid and GCC will start accepting it, I think it should still get
a warning from -Wshadow or something
More information about the Gcc-bugs
mailing list