Currently g++ doesn't warn or error on invalid code such as... template <class T> class Array1D { Array1D(int n, T *a); }; template<typename T> struct A { Array1D<int> x; A() : x(1, (const int*)0) {} }; for which clang++ produces the error... [MacPro:~] howarth% clang++ -c invalid.cc invalid.cc:7:9: error: no matching constructor for initialization of 'Array1D<int>' A() : x(1, (const int*)0) {} ^ ~~~~~~~~~~~~~~~~ invalid.cc:2:3: note: candidate constructor not viable: 2nd argument ('const int *') would lose const qualifier Array1D(int n, T *a); ^ invalid.cc:1:26: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided template <class T> class Array1D { ^ 1 error generated.
This test case originates from http://llvm.org/bugs/show_bug.cgi?id=9627.
If you instantiate the template you get an error. There are LOTS of things clang diagnoses in uninstantiated templates that g++ doesn't
The summary isn't very relevant, the problem has nothing to do with constructors, it's just that g++ doesn't check before instantiation whether no valid specialization can be formed for a template. 14.6 [temp.res] p7: If no valid specialization can be generated for a template definition, and that template is not instantiated, the template definition is ill-formed, no diagnostic required. ... [ Note: If a template is instantiated, errors will be diagnosed according to the other rules in this Standard. Exactly when these errors are diagnosed is a quality of implementation issue. βend note ]