[Bug c++/100608] [10/11/12 Regression] -Wshadow=compatible-local false positive: function local type declaration shadows variable of different type

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Apr 5 20:16:28 GMT 2022


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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |92024
   Last reconfirmed|                            |2022-04-05
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
                 CC|                            |edlinger at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org

--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> ---
This was changed by the patch for PR92024.  In the comment for that patch,
Bernd wrote "I think shadowing one type with another type of the same name is
always a no no" but then warns if either old or new decl is a type.  I think a
type and a non-type can't really be considered compatible.  Testing a patch.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92024
[Bug 92024] crash in check_local_shadow


More information about the Gcc-bugs mailing list