// { dg-do compile } // Origin: Giovanni Bajo // DR152: explicit copy constructors namespace N1 { struct X { X(); // { dg-message "candidate" } explicit X(const X&); }; void f(X); int foo() { X x; f(x); // { dg-error "matching" "matching" } // { dg-error "initializing" "initializing" { target *-*-* } 14 } } } namespace N2 { template struct X { X(); // { dg-message "candidate" } explicit X(const X&); }; template void f(T ) {} template int foo() { X x; N2::f(x); // { dg-error "matching" "matching" } // { dg-error "initializing " initializing" { target *-*-* } 33 } } template int foo(); // { dg-message "instantiated from here" } }