public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13717] New: duplicated parameter name not caught ?
@ 2004-01-17 11:28 d dot binderman at virgin dot net
2004-01-17 12:17 ` Joseph S. Myers
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: d dot binderman at virgin dot net @ 2004-01-17 11:28 UTC (permalink / raw)
To: gcc-bugs
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.
--
Summary: duplicated parameter name not caught ?
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: d dot binderman at virgin dot net
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: linux-i386
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13717
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Bug c++/13717] New: duplicated parameter name not caught ?
2004-01-17 11:28 [Bug c++/13717] New: duplicated parameter name not caught ? d dot binderman at virgin dot net
@ 2004-01-17 12:17 ` Joseph S. Myers
2004-01-17 21:20 ` Andrew Pinski
2004-01-17 23:35 ` Gabriel Dos Reis
` (3 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Joseph S. Myers @ 2004-01-17 12:17 UTC (permalink / raw)
To: gcc-bugs; +Cc: Zack Weinberg
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Bug c++/13717] New: duplicated parameter name not caught ?
2004-01-17 12:17 ` Joseph S. Myers
@ 2004-01-17 21:20 ` Andrew Pinski
2004-01-18 2:12 ` Zack Weinberg
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Pinski @ 2004-01-17 21:20 UTC (permalink / raw)
To: Joseph S. Myers; +Cc: gcc-bugs, Andrew Pinski, Zack Weinberg
On Jan 17, 2004, at 04:17, Joseph S. Myers wrote:
> 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.
It was the most recent patch which broke this as it failed still on
2004-01-01.
> (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?)
I would open just to make sure that it gets fixed.
Thanks,
Andrew Pinski
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Bug c++/13717] New: duplicated parameter name not caught ?
2004-01-17 11:28 [Bug c++/13717] New: duplicated parameter name not caught ? d dot binderman at virgin dot net
2004-01-17 12:17 ` Joseph S. Myers
@ 2004-01-17 23:35 ` Gabriel Dos Reis
2004-01-18 9:20 ` [Bug c++/13717] " dhazeghi at yahoo dot com
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Gabriel Dos Reis @ 2004-01-17 23:35 UTC (permalink / raw)
To: gcc-bugs
"d dot binderman at virgin dot net" <gcc-bugzilla@gcc.gnu.org> writes:
| The one liner
|
| void f( int fred, char * fred);
|
| is IMHO illegal code because fred is the name of two parameters.
Yes, it invalid in C++. This bug should be easier to fix in
GCC-3.4.x/g++ than GCC-3.3.x/g++.
-- Gaby
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Bug c++/13717] New: duplicated parameter name not caught ?
2004-01-17 21:20 ` Andrew Pinski
@ 2004-01-18 2:12 ` Zack Weinberg
0 siblings, 0 replies; 8+ messages in thread
From: Zack Weinberg @ 2004-01-18 2:12 UTC (permalink / raw)
To: Andrew Pinski; +Cc: Joseph S. Myers, gcc-bugs
Andrew Pinski <pinskia@physics.uc.edu> writes:
> On Jan 17, 2004, at 04:17, Joseph S. Myers wrote:
>> 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.
>
> It was the most recent patch which broke this as it failed still on
> 2004-01-01.
>
>
>> (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?)
>
> I would open just to make sure that it gets fixed.
Please do.
zw
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/13717] duplicated parameter name not caught ?
2004-01-17 11:28 [Bug c++/13717] New: duplicated parameter name not caught ? d dot binderman at virgin dot net
2004-01-17 12:17 ` Joseph S. Myers
2004-01-17 23:35 ` Gabriel Dos Reis
@ 2004-01-18 9:20 ` dhazeghi at yahoo dot com
2004-10-03 19:52 ` pinskia at gcc dot gnu dot org
2004-10-04 12:45 ` bangerth at dealii dot org
4 siblings, 0 replies; 8+ messages in thread
From: dhazeghi at yahoo dot com @ 2004-01-18 9:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dhazeghi at yahoo dot com 2004-01-18 09:20 -------
Confirmed with mainline/3.4 branch. C frontend properly rejects this, so this is
not a duplicate of PR13728.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |accepts-invalid
Last reconfirmed|0000-00-00 00:00:00 |2004-01-18 09:20:19
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13717
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/13717] duplicated parameter name not caught ?
2004-01-17 11:28 [Bug c++/13717] New: duplicated parameter name not caught ? d dot binderman at virgin dot net
` (2 preceding siblings ...)
2004-01-18 9:20 ` [Bug c++/13717] " dhazeghi at yahoo dot com
@ 2004-10-03 19:52 ` pinskia at gcc dot gnu dot org
2004-10-04 12:45 ` bangerth at dealii dot org
4 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-03 19:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-03 19:52 -------
*** Bug 17786 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |rth at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13717
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/13717] duplicated parameter name not caught ?
2004-01-17 11:28 [Bug c++/13717] New: duplicated parameter name not caught ? d dot binderman at virgin dot net
` (3 preceding siblings ...)
2004-10-03 19:52 ` pinskia at gcc dot gnu dot org
@ 2004-10-04 12:45 ` bangerth at dealii dot org
4 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2004-10-04 12:45 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-10-04 12:45 -------
As mentioned in PR 17786 by Nathan:
correct. there is a related bug in that we fail to compile things like
void foo (int x, int ary[sizeof(x)]);
--
What |Removed |Added
----------------------------------------------------------------------------
Known to fail|3.3.2 3.4.0 4.0 |3.3.2 3.4.0 4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13717
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-10-04 12:45 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-17 11:28 [Bug c++/13717] New: duplicated parameter name not caught ? d dot binderman at virgin dot net
2004-01-17 12:17 ` Joseph S. Myers
2004-01-17 21:20 ` Andrew Pinski
2004-01-18 2:12 ` Zack Weinberg
2004-01-17 23:35 ` Gabriel Dos Reis
2004-01-18 9:20 ` [Bug c++/13717] " dhazeghi at yahoo dot com
2004-10-03 19:52 ` pinskia at gcc dot gnu dot org
2004-10-04 12:45 ` bangerth at dealii dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).