public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17786] New: Duplicate parameter names not diagnosed in declarations.
@ 2004-10-01 22:50 rth at gcc dot gnu dot org
  2004-10-01 22:53 ` [Bug c++/17786] " dberlin at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: rth at gcc dot gnu dot org @ 2004-10-01 22:50 UTC (permalink / raw)
  To: gcc-bugs

struct S { int sum(int x, int x); };

By my reading of [dcl.fct]/8, "... since it goes out of scope at the end of the
function declarator ..." implies that we *should* be treating this as a proper
scope and not ignoring the duplicate decl.

DannyB sez icpc agrees and issues a hard error.

Not a regression; fails as far back as 2.95.

-- 
           Summary: Duplicate parameter names not diagnosed in declarations.
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rth at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17786


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/17786] Duplicate parameter names not diagnosed in declarations.
  2004-10-01 22:50 [Bug c++/17786] New: Duplicate parameter names not diagnosed in declarations rth at gcc dot gnu dot org
@ 2004-10-01 22:53 ` dberlin at gcc dot gnu dot org
  2004-10-02 12:23 ` nathan at gcc dot gnu dot org
  2004-10-03 19:52 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2004-10-01 22:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at gcc dot gnu dot org  2004-10-01 22:53 -------
dberlin@linux:~> icpc cpp.cpp
cpp.cpp(3): error: duplicate parameter name
        int sum(int x, int x);
                           ^

compilation aborted for cpp.cpp (code 2)
dberlin@linux:~> icpc -V
Intel(R) C++ Compiler for 32-bit applications, Version 8.1 ...


I haven't tried earlier versions of Intel C++, but Comeau's online tester gives
the same results for all the versions they have online.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17786


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/17786] Duplicate parameter names not diagnosed in declarations.
  2004-10-01 22:50 [Bug c++/17786] New: Duplicate parameter names not diagnosed in declarations rth at gcc dot gnu dot org
  2004-10-01 22:53 ` [Bug c++/17786] " dberlin at gcc dot gnu dot org
@ 2004-10-02 12:23 ` nathan at gcc dot gnu dot org
  2004-10-03 19:52 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: nathan at gcc dot gnu dot org @ 2004-10-02 12:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From nathan at gcc dot gnu dot org  2004-10-02 12:23 -------
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
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-10-02 12:23:16
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17786


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/17786] Duplicate parameter names not diagnosed in declarations.
  2004-10-01 22:50 [Bug c++/17786] New: Duplicate parameter names not diagnosed in declarations rth at gcc dot gnu dot org
  2004-10-01 22:53 ` [Bug c++/17786] " dberlin at gcc dot gnu dot org
  2004-10-02 12:23 ` nathan at gcc dot gnu dot org
@ 2004-10-03 19:52 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ 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 -------
And there is already a dup of this bug, PR 13717.

*** This bug has been marked as a duplicate of 13717 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17786


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-10-03 19:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-01 22:50 [Bug c++/17786] New: Duplicate parameter names not diagnosed in declarations rth at gcc dot gnu dot org
2004-10-01 22:53 ` [Bug c++/17786] " dberlin at gcc dot gnu dot org
2004-10-02 12:23 ` nathan at gcc dot gnu dot org
2004-10-03 19:52 ` pinskia at gcc dot gnu 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).