From: Jason Merrill Date: Wed, 31 May 2000 08:14:17 +0000 (-0400) Subject: new X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d2474533e1057bf631f9a3aa4c08c3f09744e3ae;p=gcc.git new From-SVN: r34289 --- 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 + +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