This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Bug c++/13717] New: duplicated parameter name not caught ?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]