help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

g++ 4.0.0: ambiguous conversion resolved in favor of conversion operator


From: Angel Tsankov
Subject: g++ 4.0.0: ambiguous conversion resolved in favor of conversion operator?
Date: Mon, 6 Mar 2006 10:27:23 +0200

g++ 4.0.0 compiles the following code (and calls the conversion operator). However, this code is ambiguous and should not compile. Is this bug fixed in later releases?

struct b;

struct a
{
a( ) { }
a( b const& ) { }
};

struct b
{
operator a( ) const { return a( ); }
};

void f( a )
{
}

int main
(
)
{
b B;
f( B );

return 0;
}


reply via email to

[Prev in Thread] Current Thread [Next in Thread]