https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56556
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|RESOLVED |NEW Resolution|INVALID |--- Last reconfirmed| |2022-02-04 Severity|normal |enhancement Keywords| |diagnostic --- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- The problem with -Wshadow=local is that it doesn't warn about this either: class Derived { int x; Derived(int x) {} }; And you might want a warning there, just not for the case where 'x' is a private member in some base. I think I agree with David that this shouldn't warn in the first place, you shouldn't need to work around it. I understand Andrew's explanation, but that's the reason GCC behaves like this today, not a reason it *should* behave like this.