From-SVN: r34289
This commit is contained in:
Jason Merrill 2000-05-31 04:14:17 -04:00
parent 6fbc37cc6f
commit d2474533e1
2 changed files with 29 additions and 0 deletions

View 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
}

View 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