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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-08-22
                 CC|                            |egallager at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Vittorio Romeo from comment #0)
> struct Base { int a; };
> struct Derived : Base  { int a; };
> int main() { }
> 
> The code snippet above produces no warnings with `-Wshadow` enabled. 
> This seems like an unusual situation that could lead to unexpected behavior.
> 
> I suggest producing a warning when `-Wshadow` is enabled, to alert that
> `Derived::a` is shadowing `Base::a`.
> 
> Related SO question:
> https://stackoverflow.com/questions/40908402

Confirmed that no warnings are produced.

(In reply to Vittorio Romeo from comment #1)
> Forgot to set an appropriate importance level, and I can't seem to edit it.
> Sorry.

That's okay, leaving it as the default is probably better.

Reply via email to