void f (int fred, int fred); void f2 (int fred, int fred) {} does not get any diagnostics with current 3.4 or 3.5 CVS. 3.3.2 gives proper errors (albeit with some duplication): t.c:1: error: redefinition of `fred' t.c:1: error: `fred' previously declared here t.c:2: error: redefinition of `fred' t.c:2: error: `fred' previously declared here t.c: In function `f2': t.c:2: error: redeclaration of `fred' t.c:2: error: `fred' previously declared here
Confirmed on mainline/3.4 branch.
Oops, I guess that's a regression.
Subject: Fix PR 13728 This is the missing diagnostic for void f (int fred, int fred) and a missing diagnostic is precisely what it is. Simply a case that fell through the cracks when I split up duplicate_decls. Fixed thus; bootstrapped i686-linux, applied mainline and 3.4 branch. PR 13728 * c-decl.c (diagnose_mismatched_decls): Issue an error for two parameters with the same name, unless one is a forward decl. Do not issue a redundant-redeclaration warning for forward decls of parameters. * gcc.dg/decl-4.c: New testcase.
Created attachment 5858 [details] pr13728.diff
Subject: Bug 13728 CVSROOT: /cvs/gcc Module name: gcc Changes by: zack@gcc.gnu.org 2004-03-04 05:49:07 Modified files: gcc : ChangeLog c-decl.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.dg: decl-4.c Log message: PR 13728 * c-decl.c (diagnose_mismatched_decls): Issue an error for two parameters with the same name, unless one is a forward decl. Do not issue a redundant-redeclaration warning for forward decls of parameters. * gcc.dg/decl-4.c: New testcase. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3030&r2=2.3031 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&r1=1.481&r2=1.482 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3565&r2=1.3566 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/decl-4.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 13728 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: zack@gcc.gnu.org 2004-03-04 05:53:35 Modified files: gcc : ChangeLog c-decl.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.dg: decl-4.c Log message: PR 13728 * c-decl.c (diagnose_mismatched_decls): Issue an error for two parameters with the same name, unless one is a forward decl. Do not issue a redundant-redeclaration warning for forward decls of parameters. * gcc.dg/decl-4.c: New testcase. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.285&r2=2.2326.2.286 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.470.4.5&r2=1.470.4.6 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.119&r2=1.3389.2.120 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/decl-4.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
there