aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/cvt5.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.law/cvt5.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/cvt5.C28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.law/cvt5.C b/gcc/testsuite/g++.old-deja/g++.law/cvt5.C
new file mode 100644
index 00000000000..d244b4f5225
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.law/cvt5.C
@@ -0,0 +1,28 @@
+// Build don't link:
+// GROUPS passed conversions
+// cvt file
+// Message-Id: <1992Jul31.142856.10082@ericsson.se>
+// From: jonas@ericsson.se (Jonas Nygren)
+// Subject: g++ bug
+// Date: Fri, 31 Jul 1992 14:28:56 GMT
+
+class A {};
+class B : public A {};
+
+B b;
+
+class R{
+public:
+ R() {}
+ operator B&() { return b; }
+};
+
+void f(A&) {}
+
+main(){
+ R r;
+
+ f(r); // problem to cast to B& and then to A&
+}
+
+