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;
}
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to