http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18610
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #7 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2011-09-21
14:28:05 UTC ---
(In reply to comment #6)
> N.B. that's even better than clang, as it tells you *why* substitution failed:
> the specialization Q<int> is incomplete
Great!
I agree it is better that it tells you *why*, but g++'s output is also
extremely verbose: 2 diagnostics versus 8, plus the repetition of
'template<class T> F<typename Q<T>::t> g(const F<T>&)' and 'struct Q<int>'.
Moreover, the use of "note" and "error" is inconsistent.
I would wish for something like:
t.cc:17:9: error: no matching function for call to 'g'
t.cc:12:22: note: candidate template ignored: template argument
deduction/substitution failed [with T = int]
t.cc:12:22: note: reason: invalid use of incomplete type 'struct Q<int>'
t.cc:2:8: note: declared here
Current output will explode with large number of candidates and complex
template instantiations (e.g., STL stuff). But that is an old problem, in
general, and I guess hard to fix in g++.
Let's mark this as FIXED in GCC 4.7. If someone disagrees, just reopen it.