// RUN: %clang_cc1 -fsyntax-only -verify %s template struct A{ A(); // expected-note{{candidate constructor not viable: requires 0 arguments, but 1 was provided}} A(A&); // expected-note{{candidate constructor not viable: expects an lvalue for 1st argument}} A(A); // expected-error{{copy constructor must pass its first argument by reference}} }; void f() { A a = A(); // expected-note{{in instantiation of template class 'A'}} A a1 = A(); // No error (not a copy constructor) } // Test rvalue-to-lvalue conversion in copy constructor A &&a(void); void g() { A a2 = a(); // expected-error{{no matching constructor}} } template struct B{ B(); template B(U); // No error (templated constructor) }; void h() { B b = B(); // should use implicit copy constructor }