This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug c++/13717] New: duplicated parameter name not caught ?
- From: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- To: gcc-bugs at gcc dot gnu dot org
- Cc: Zack Weinberg <zack at codesourcery dot com>
- Date: Sat, 17 Jan 2004 12:17:33 +0000 (UTC)
- Subject: Re: [Bug c++/13717] New: duplicated parameter name not caught ?
- References: <20040117112758.13717.d.binderman@virgin.net>
On Sat, 17 Jan 2004, d dot binderman at virgin dot net wrote:
> The one liner
>
> void f( int fred, char * fred);
>
> is IMHO illegal code because fred is the name of two parameters.
>
> I couldn't get gcc332 to find the bug in this code.
> This is salted down from real code in Fedora Core 1.
If you give the parameters the same type, then the C front end has
acquired such a bug as well in 3.4/3.5. Neither
void f (int fred, int fred);
nor
void f (int fred, int fred) {}
now give a diagnostic for C. I guess Zack's patches are the most likely
cause, or at least the subsequent ones the most likely fix.
(Sent to gcc-bugs rather than gcc-bugzilla because this is a separate bug.
Shall I open a new PR for this regression or will this be fixed shortly
(with the above testcases included) in a subsequent stage of the c-decl.c
cleanup patches?)
--
Joseph S. Myers
jsm@polyomino.org.uk