public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13717] duplicated parameter name not caught ?
[not found] <bug-13717-1563@http.gcc.gnu.org/bugzilla/>
@ 2006-03-15 10:43 ` dcb314 at hotmail dot com
2006-05-29 15:13 ` rguenth at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: dcb314 at hotmail dot com @ 2006-03-15 10:43 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from dcb314 at hotmail dot com 2006-03-15 10:42 -------
(In reply to comment #0)
> The one liner
>
> void f( int fred, char * fred);
>
> is IMHO illegal code because fred is the name of two parameters.
I just checked gcc 4.2 and it is broken there as well.
Even adding flags -Wall -ansi -pedantic doesn't help
--
dcb314 at hotmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dcb314 at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13717
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/13717] duplicated parameter name not caught ?
[not found] <bug-13717-1563@http.gcc.gnu.org/bugzilla/>
2006-03-15 10:43 ` [Bug c++/13717] duplicated parameter name not caught ? dcb314 at hotmail dot com
@ 2006-05-29 15:13 ` rguenth at gcc dot gnu dot org
2006-05-29 16:26 ` mueller at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-29 15:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from rguenth at gcc dot gnu dot org 2006-05-29 15:13 -------
Based on 8.3.5/8 and the example from 8.3.6/9 which reads
int f(int a, int b = a);
I think this bug is invalid and function declarations with duplicate parameter
names are not invalid.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13717
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/13717] duplicated parameter name not caught ?
[not found] <bug-13717-1563@http.gcc.gnu.org/bugzilla/>
2006-03-15 10:43 ` [Bug c++/13717] duplicated parameter name not caught ? dcb314 at hotmail dot com
2006-05-29 15:13 ` rguenth at gcc dot gnu dot org
@ 2006-05-29 16:26 ` mueller at gcc dot gnu dot org
2006-05-29 22:34 ` dcb314 at hotmail dot com
` (3 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: mueller at gcc dot gnu dot org @ 2006-05-29 16:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from mueller at gcc dot gnu dot org 2006-05-29 16:26 -------
it might not be invalid, but its certainly worth a diagnostic IMHO
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13717
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/13717] duplicated parameter name not caught ?
[not found] <bug-13717-1563@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2006-05-29 16:26 ` mueller at gcc dot gnu dot org
@ 2006-05-29 22:34 ` dcb314 at hotmail dot com
2008-01-16 18:26 ` tsarkov at cs dot man dot ac dot uk
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: dcb314 at hotmail dot com @ 2006-05-29 22:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from dcb314 at hotmail dot com 2006-05-29 22:34 -------
(In reply to comment #5)
> Based on 8.3.5/8 and the example from 8.3.6/9 which reads
>
> int f(int a, int b = a);
>
> I think this bug is invalid and function declarations with duplicate parameter
> names are not invalid.
I don't understand how the line of code you mention helps
demonstrate your logic. Two parameters are declared, one
called a and one called b.
In the standard, the end of paragraph 8.3.5.7 says
If a parameter name is present in a function
declaration that is not a definition, it cannot be used outside of the
parameter-declaration-clause since it goes out of scope at the end of
the function declarator
So it implies that a new scope is entered at the (
and exited at the ). But we already know that a name can't
be reused at the same scope [ except for function overloading,
but that's different]. QED.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13717
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/13717] duplicated parameter name not caught ?
[not found] <bug-13717-1563@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2006-05-29 22:34 ` dcb314 at hotmail dot com
@ 2008-01-16 18:26 ` tsarkov at cs dot man dot ac dot uk
2008-01-22 22:16 ` bangerth at dealii dot org
2008-01-23 0:14 ` manu at gcc dot gnu dot org
6 siblings, 0 replies; 10+ messages in thread
From: tsarkov at cs dot man dot ac dot uk @ 2008-01-16 18:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from tsarkov at cs dot man dot ac dot uk 2008-01-16 17:39 -------
This is fixed in current mainline GCC (as per
http://gcc.gnu.org/gcc-4.3/porting_to.html).
--
tsarkov at cs dot man dot ac dot uk changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tsarkov at cs dot man dot ac
| |dot uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13717
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/13717] duplicated parameter name not caught ?
[not found] <bug-13717-1563@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2008-01-16 18:26 ` tsarkov at cs dot man dot ac dot uk
@ 2008-01-22 22:16 ` bangerth at dealii dot org
2008-01-23 0:14 ` manu at gcc dot gnu dot org
6 siblings, 0 replies; 10+ messages in thread
From: bangerth at dealii dot org @ 2008-01-22 22:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from bangerth at dealii dot org 2008-01-22 22:06 -------
Apparently fixed.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13717
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/13717] duplicated parameter name not caught ?
[not found] <bug-13717-1563@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2008-01-22 22:16 ` bangerth at dealii dot org
@ 2008-01-23 0:14 ` manu at gcc dot gnu dot org
6 siblings, 0 replies; 10+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-01-23 0:14 UTC (permalink / raw)
To: gcc-bugs
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13717
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/13717] duplicated parameter name not caught ?
2004-01-17 11:28 [Bug c++/13717] New: " d dot binderman at virgin dot net
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
2 siblings, 0 replies; 10+ 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] 10+ messages in thread
* [Bug c++/13717] duplicated parameter name not caught ?
2004-01-17 11:28 [Bug c++/13717] New: " d dot binderman at virgin dot net
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
2 siblings, 0 replies; 10+ 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] 10+ messages in thread
* [Bug c++/13717] duplicated parameter name not caught ?
2004-01-17 11:28 [Bug c++/13717] New: " d dot binderman at virgin dot net
@ 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
2 siblings, 0 replies; 10+ 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] 10+ messages in thread
end of thread, other threads:[~2008-01-23 0:00 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-13717-1563@http.gcc.gnu.org/bugzilla/>
2006-03-15 10:43 ` [Bug c++/13717] duplicated parameter name not caught ? dcb314 at hotmail dot com
2006-05-29 15:13 ` rguenth at gcc dot gnu dot org
2006-05-29 16:26 ` mueller at gcc dot gnu dot org
2006-05-29 22:34 ` dcb314 at hotmail dot com
2008-01-16 18:26 ` tsarkov at cs dot man dot ac dot uk
2008-01-22 22:16 ` bangerth at dealii dot org
2008-01-23 0:14 ` manu at gcc dot gnu dot org
2004-01-17 11:28 [Bug c++/13717] New: " d dot binderman at virgin dot net
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).