new
authorJason Merrill <jason@gcc.gnu.org>
Wed, 31 May 2000 08:14:17 +0000 (04:14 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 31 May 2000 08:14:17 +0000 (04:14 -0400)
From-SVN: r34289

gcc/testsuite/g++.old-deja/g++.other/explicit1.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.other/refinit1.C [new file with mode: 0644]

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 (file)
index 0000000..7baf04f
--- /dev/null
@@ -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 (file)
index 0000000..2f01e16
--- /dev/null
@@ -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