------- Comment #3 from rguenth at gcc dot gnu dot org 2006-01-19 13:09 ------- 14.7.3/11 and /12 suggest, that while having the template-argument unspecified in the template-id is valid only if the template-argument can be deduced from the function arguments unambiguously (it does not say if a diagnostic is required). For the example:
template <typename T> bool qCompare(const T *t1, const T *t2); template <typename T> bool qCompare(T *t1, T *t2); template <typename T1, typename T2> bool qCompare(const T1 *t1, const T2 *t2); template<> bool qCompare(const char *t1, const char *t2) {} it is ambiguous whether the specialization uses the template-argument const char or char. See example in /12. Whether the gcc behavior to just ignore this decl as a specialization is correct or not I don't know. Needless to say, EDG accepts the testcase without problems... As an advice to the programmer I would say -DWORKAROUND is a good way to avoid the ambiguity. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25855