Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.old-deja/g++.other/overload12.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
line wrap: on
line source
// { dg-do assemble } // 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& }