public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/9217: Possible Ambiguity leads to confusing error, or - compiler rejects legal-code: fails to solve ambiguity.
@ 2003-01-07 13:16 carlo
0 siblings, 0 replies; 2+ messages in thread
From: carlo @ 2003-01-07 13:16 UTC (permalink / raw)
To: gcc-gnats
>Number: 9217
>Category: c++
>Synopsis: Possible Ambiguity leads to confusing error, or - compiler rejects legal-code: fails to solve ambiguity.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Tue Jan 07 05:16:04 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: Carlo Wood
>Release: 3.2.1
>Organization:
>Environment:
>Description:
I don't know if this is a compiler bug - but we thought
that the real guru's should have a look at it, just in case.
g++ -c troep.cc
troep.cc: In function `void f()':
troep.cc:10: cannot declare static function inside another function
>How-To-Repeat:
Compile the following code with g++ -c troep.cc
struct A { A(char const*); };
struct B { B(A const&); };
struct C { C(B const&); };
void f()
{
char const* const str = "t";
static C c1( B("t") ); // Works.
static C c2( (B(str)) ); // Works.
static C c3( B(str) ); // Fails.
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: c++/9217: Possible Ambiguity leads to confusing error, or - compiler rejects legal-code: fails to solve ambiguity.
@ 2003-01-07 13:31 nathan
0 siblings, 0 replies; 2+ messages in thread
From: nathan @ 2003-01-07 13:31 UTC (permalink / raw)
To: carlo, gcc-bugs, gcc-prs, nobody
Synopsis: Possible Ambiguity leads to confusing error, or - compiler rejects legal-code: fails to solve ambiguity.
State-Changed-From-To: open->closed
State-Changed-By: nathan
State-Changed-When: Tue Jan 7 05:31:08 2003
State-Changed-Why:
not a bug.
static C c3( B(str) );
is a prototype for c3 taking an argument B with a
parenthesized parameter name. dcl.ambig.res says we
should parse it as such , and not a variable with
initializer.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9217
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-01-07 13:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-07 13:16 c++/9217: Possible Ambiguity leads to confusing error, or - compiler rejects legal-code: fails to solve ambiguity carlo
2003-01-07 13:31 nathan
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).