[Bug c++/94588] New: Improve redeclared parameter name diagnostic

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Apr 13 22:56:49 GMT 2020


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

            Bug ID: 94588
           Summary: Improve redeclared parameter name diagnostic
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

void
f (int i)
{
  int i;
}

is correctly rejected ([basic.scope.param]) but we don't print the previous
decl:

$ g++ -c p.C
p.C: In function ‘void f(int)’:
p.C:4:7: error: declaration of ‘int i’ shadows a parameter
    4 |   int i;
      |       ^


More information about the Gcc-bugs mailing list