diff options
author | Jason Merrill <jason@gcc.gnu.org> | 2000-05-31 04:14:17 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2000-05-31 04:14:17 -0400 |
commit | d2474533e1057bf631f9a3aa4c08c3f09744e3ae (patch) | |
tree | ba5d69344189e33cefc5efd6a05bd4119fa7b752 /gcc | |
parent | 6fbc37cc6fa7abfe11fcbf1084361abeaaac0595 (diff) | |
download | gcc-d2474533e1057bf631f9a3aa4c08c3f09744e3ae.zip gcc-d2474533e1057bf631f9a3aa4c08c3f09744e3ae.tar.gz gcc-d2474533e1057bf631f9a3aa4c08c3f09744e3ae.tar.bz2 |
new
From-SVN: r34289
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/explicit1.C | 12 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/refinit1.C | 17 |
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 0000000..7baf04f --- /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 0000000..2f01e16 --- /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 |