http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48934

Nathan Froyd <froydnj at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #9 from Nathan Froyd <froydnj at gcc dot gnu.org> 2011-05-09 
17:10:31 UTC ---
(In reply to comment #8)
> The point of that example is that even clang's "substitution failed" could be
> improved, because T is substituted successfully into the return type
> "S1<T>::type" but not into the parameter type "S1<T>::typo" (in the general
> case they wouldn't both use S1 and there could be several parameters)
> 
> So a better reason would be "substitution failed for parameter 1" but I don't
> know how easy that is, if it's even possible in the current G++ codebase

It is possible; it's just a bit tedious, since you'd need to thread the
unification_info all the way through template substitution, not just function
type deduction.  I don't know how Jason would feel about the extra parameter
and corresponding call overhead to tsubst, though.  Jason?

(IIUC, doing this would also enable you to precisely report which
sub-expression substitution failed in.)

The hackish way of doing this would be to notice during deduction that
substitution of a function type failed, then go back and substitute piece-wise
into return type and argument types until you find the failing type.  That
could be done without the changes above, but it'd be a bit gross.

Reply via email to