aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorNeil Booth <neil@gcc.gnu.org>2000-11-26 17:26:59 +0000
committerNeil Booth <neil@gcc.gnu.org>2000-11-26 17:26:59 +0000
commite1085962754472b391d366d591f66e2413c8faa7 (patch)
tree1f2a4d69ce67399acdf75a8cf32ad734261a7364 /gcc/testsuite
parent25080928b1f955e7334139039505892adf290855 (diff)
downloadgcc-e1085962754472b391d366d591f66e2413c8faa7.zip
gcc-e1085962754472b391d366d591f66e2413c8faa7.tar.gz
gcc-e1085962754472b391d366d591f66e2413c8faa7.tar.bz2
* g++.old-deja/g++.other/overload12.C
From-SVN: r37760
Diffstat (limited to 'gcc/testsuite')
-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 0000000..7e546da
--- /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&
+}