------- Comment #6 from jakub at gcc dot gnu dot org 2010-04-14 16:06 ------- Created an attachment (id=20378) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20378&action=view) gcc46-pr43728.patch
Updated patch. There are still cases I'm unsure about. E.g. for: static void g (); void f() { void g(); g(); } void g() { } int main () { f (); } with -Wredundant-decls=2 in C we complain (even with -Wredundant-decls alone and before the patch) that void g(); in f function is redundant declaration, but in C++ we don't and instead with -Wredundant-decls=2 the warning newly diagnoses the first static void g (); prototype as redundant (in this case it isn't, because it affects whether void g (); in the subroutine is static or not). Not sure why TREE_USED isn't set in C++ case during the g call in f, Jason? -- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #20367|0 |1 is obsolete| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43728