summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2000-05-31 08:14:17 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2000-05-31 08:14:17 +0000
commit04da1b8993f34f10d0b39a0b15b4bb7ef732d8fa (patch)
treeba5d69344189e33cefc5efd6a05bd4119fa7b752
parent8732f87f1a170c629c3a384ea15581579ded0cbf (diff)
downloadppe42-gcc-04da1b8993f34f10d0b39a0b15b4bb7ef732d8fa.tar.gz
ppe42-gcc-04da1b8993f34f10d0b39a0b15b4bb7ef732d8fa.zip
new
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34289 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/explicit1.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/refinit1.C17
2 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/explicit1.C b/gcc/testsuite/g++.old-deja/g++.other/explicit1.C
new file mode 100644
index 00000000000..7baf04febfc
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/explicit1.C
@@ -0,0 +1,12 @@
+// Origin: Jason Merrill <jason@redhat.com>
+
+struct A
+{
+ A ();
+ explicit A (int);
+};
+
+int main ()
+{
+ const A& r = 1; // ERROR - no suitable constructor
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/refinit1.C b/gcc/testsuite/g++.old-deja/g++.other/refinit1.C
new file mode 100644
index 00000000000..2f01e16043f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/refinit1.C
@@ -0,0 +1,17 @@
+// Test that we don't allow multiple user-defined conversions in reference
+// initialization.
+// Build don't link:
+
+struct B { };
+
+struct A {
+ A (const B&);
+};
+
+struct C {
+ operator B ();
+};
+
+C c;
+
+const A& ref (c); // ERROR - requires two UDCs
OpenPOWER on IntegriCloud