https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91868
Bug ID: 91868 Summary: wrong location info with -Wshadow on C++ constructors Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: bernd.edlinger at hotmail dot de Target Milestone: --- While playing with -Wshadow I saw a wrong location info creating a confusing warning (but I think other warnings have similar issues): $ cat test.cc enum x {a}; struct c { c (x, x); }; void foo () { int xx; { c xx ( a, a); } } $ $ gcc -Wshadow -c test.cc test.cc: In function 'void foo()': test.cc:14:7: warning: declaration of 'xx' shadows a previous local [-Wshadow] 14 | ( a, a); | ^ test.cc:11:7: note: shadowed declaration is here 11 | int xx; | ^~