2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / overload12.C
blob2e37f07c998b1a02ba2bb309c528cb868a47132c
1 // { dg-do assemble  }
2 // Origin: Neil Booth <neilb@earthling.net> from bug #27.
4 struct A{};
6 struct B:A{};
8 struct C:B{};
10 struct CX
12   C  c;
14   operator C&(){return c;}
17 // viable functions for call below
18 void f(A&);
19 void f(B&);
21 int main()
23   CX cx;
24   C  c;
26   f(c);   // the standard conversion to B& is better than to A& 
28   f(cx);  // after user defined conversion to C&
29   // the standard conversion to B& is better than to A&