* [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