new
From-SVN: r34289
This commit is contained in:
parent
6fbc37cc6f
commit
d2474533e1
2 changed files with 29 additions and 0 deletions
12
gcc/testsuite/g++.old-deja/g++.other/explicit1.C
Normal file
12
gcc/testsuite/g++.old-deja/g++.other/explicit1.C
Normal file
|
@ -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
|
||||
}
|
17
gcc/testsuite/g++.old-deja/g++.other/refinit1.C
Normal file
17
gcc/testsuite/g++.old-deja/g++.other/refinit1.C
Normal file
|
@ -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
|
Loading…
Add table
Reference in a new issue