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