Consider the following one-liner:
int func(int foo, int (*fn)(int foo));
Current g++ complains about shadowing, which seems incorrect to me:
~/tmp>g++ -c -W -Wall -Wshadow bug.cc
bug.cc:1: warning: declaration of 'int foo' shadows a parameter
bug.cc:1: warning: shadowed declaration is here
Curiously, no warning is generated by g++ 4.3.
gcc 4.4 and 4.3 don't produce the warning either.
--
Summary: [4.4 regression] Incorrect warning with -Wshadow
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: martin at mpa-garching dot mpg dot de
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38022