c++: Improve redeclared parameter name diagnostic [PR94588]
authorMarek Polacek <polacek@redhat.com>
Mon, 13 Apr 2020 23:06:39 +0000 (19:06 -0400)
committerMarek Polacek <polacek@redhat.com>
Tue, 14 Apr 2020 03:12:31 +0000 (23:12 -0400)
commit7eee265e6bd58bf48da70fef97f2ac7179a9f41c
tree8ebe35cd57de1d1b3b53a466bd5d453ddce37bff
parente020d2bbe80dd07cbd147ff4eaf5896a60c13575
c++: Improve redeclared parameter name diagnostic [PR94588]

While reviewing [basic.scope.param] I noticed we don't show the location
of the previous declaration when giving an error about "A parameter name
shall not be redeclared in the outermost block of the function definition".

PR c++/94588
* name-lookup.c (check_local_shadow): Add an inform call.

* g++.dg/diagnostic/redeclaration-1.C: Add dg-message.
gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/diagnostic/redeclaration-1.C