Commit e1085962 by Neil Booth

* g++.old-deja/g++.other/overload12.C

From-SVN: r37760
parent 25080928
// Build don't link:
// Origin: Neil Booth <neilb@earthling.net> from bug #27.
struct A{};
struct B:A{};
struct C:B{};
struct CX
{
C c;
operator C&(){return c;}
};
// viable functions for call below
void f(A&);
void f(B&);
int main()
{
CX cx;
C c;
f(c); // the standard conversion to B& is better than to A&
f(cx); // after user defined conversion to C&
// the standard conversion to B& is better than to A&
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment