1// { dg-do assemble } 2// Origin: Neil Booth <neilb@earthling.net> from bug #27. 3 4struct A{}; 5 6struct B:A{}; 7 8struct C:B{}; 9 10struct CX 11{ 12 C c; 13 14 operator C&(){return c;} 15}; 16 17// viable functions for call below 18void f(A&); 19void f(B&); 20 21int main() 22{ 23 CX cx; 24 C c; 25 26 f(c); // the standard conversion to B& is better than to A& 27 28 f(cx); // after user defined conversion to C& 29 // the standard conversion to B& is better than to A& 30} 31