The following invalid code is not rejected by clang for incompatible template parameter list between ctor and class definition:
template <class TClass, int NON=0>
class T
{
public:
T<TClass>(int f) {}
};
int main(){
T<int> t(10);
}
EDG and GCC reject it. The diagnostic of GCC is weird though.
EDG rejects it with the following diagnostic, which seems more reasonable.
"<source>", line 5: error: type used as constructor name does not match type "T<TClass, NON>"
T<TClass>(int f) {}
^
1 error detected in the compilation of "<source>".
Please see https://godbolt.org/z/s3KK85qxo