summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-26 17:26:59 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-26 17:26:59 +0000
commit7302865bf8517375d18bbd72b77187ce66ff6f4f (patch)
tree1f2a4d69ce67399acdf75a8cf32ad734261a7364
parentec8618cecab2c6adb4815a1fb141cb601526496f (diff)
downloadppe42-gcc-7302865bf8517375d18bbd72b77187ce66ff6f4f.tar.gz
ppe42-gcc-7302865bf8517375d18bbd72b77187ce66ff6f4f.zip
* g++.old-deja/g++.other/overload12.C
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37760 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overload12.C30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload12.C b/gcc/testsuite/g++.old-deja/g++.other/overload12.C
new file mode 100644
index 00000000000..7e546da8626
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/overload12.C
@@ -0,0 +1,30 @@
+// 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&
+}
OpenPOWER on IntegriCloud