Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / g++.dg / overload / reftemp2.C
blob365d5b13f5065a97a944343aae0e3cf9ee2007dd
1 // DR 391 says that we always bind a reference to the base subobject; it is
2 // incorrect to call the A copy constructor to initialize the parameter of
3 // f.
5 int fail;
7 struct A {
8   A() { }
9   A(const A&) { fail = 1; }
11 struct B : public A { };
12 struct X {
13   operator B() { return B(); }
15 X x;
17 void f (const A&) { }
19 int main()
21   f(x);
22   return fail;