c++/9217: Possible Ambiguity leads to confusing error, or - compiler rejects legal-code: fails to solve ambiguity.
carlo@alinoe.com
carlo@alinoe.com
Mon Jan 13 05:17:00 GMT 2003
>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:
More information about the Gcc-bugs
mailing list