public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/5685: g++ 3.0.2 allows multiple identical declaration of default argument
@ 2002-02-17  9:24 rodrigc
  0 siblings, 0 replies; 3+ messages in thread
From: rodrigc @ 2002-02-17  9:24 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, rhu

Synopsis: g++ 3.0.2 allows multiple identical declaration of default argument

State-Changed-From-To: open->analyzed
State-Changed-By: rodrigc
State-Changed-When: Sun Feb 17 09:24:36 2002
State-Changed-Why:
    You are right, this should be an error, according to [8.3.6].
    
    If you compile with the -pedantic switch, you will get
    a warning, but this should still be an error.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5685


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

* Re: c++/5685: g++ 3.0.2 allows multiple identical declaration of default argument
@ 2002-02-17 19:03 rodrigc
  0 siblings, 0 replies; 3+ messages in thread
From: rodrigc @ 2002-02-17 19:03 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, rhu

Synopsis: g++ 3.0.2 allows multiple identical declaration of default argument

State-Changed-From-To: analyzed->closed
State-Changed-By: rodrigc
State-Changed-When: Sun Feb 17 19:03:10 2002
State-Changed-Why:
    Fixed in gcc 3.1:
    http://gcc.gnu.org/ml/gcc-patches/2002-02/msg01169.html
    
    For gcc 3.0.x, use the -pedantic-errors to treat
    this testcase as an error.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5685


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

* c++/5685: g++ 3.0.2 allows multiple identical declaration of default argument
@ 2002-02-14  2:06 Rick Hu
  0 siblings, 0 replies; 3+ messages in thread
From: Rick Hu @ 2002-02-14  2:06 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5685
>Category:       c++
>Synopsis:       g++ 3.0.2 allows multiple identical declaration of default argument
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          accepts-illegal
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 14 02:06:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Rick Hu
>Release:        3.0.2
>Organization:
Goldman Sachs
>Environment:
System: SunOS ninjin 5.6 Generic_105181-23 sun4u sparc SUNW,Ultra-80
Architecture: sun4

	
host: sparc-sun-solaris2.6
build: sparc-sun-solaris2.6
target: sparc-sun-solaris2.6
configured with: ../gcc-3.0.2/configure --prefix=/home/rhu/local/local/gcc-3.0.2 --enable-languages=c,c++
>Description:
	ISO C++ Standard clause 8.3.6 Default arguments says:
	A default argument shall not be redefined by a later declaration (not even to the same value).

	The g++ compiler allows a later declaration to the same value.

>How-To-Repeat:

SOURCE CODE "foo.cc"

#include <iostream>

void foo(int, int = 0);
void foo(int, int = 0);

void foo(int a, int b)
{
	std::cout << a << std::endl;
	std::cout << b << std::endl;
}

main()
{
	foo(1, 2);
	foo(3);
}




>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2002-02-18  3:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-17  9:24 c++/5685: g++ 3.0.2 allows multiple identical declaration of default argument rodrigc
  -- strict thread matches above, loose matches on Subject: below --
2002-02-17 19:03 rodrigc
2002-02-14  2:06 Rick Hu

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).