[Bug c++/12672] Evals template defaults args that it should not

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jan 15 19:39:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12672

--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Template argument deduction requires substituting the template arguments where
they appear. If that is in the return type, it gets substituted into the return
type. If that causes a substitution error then deduction fails (that is how
using enable_if on the return type works, it *must* consider the return type
during argument deduction for that  to work!). If it causes an error outside
the immediate context you get an error, not deduction failure (14.8.2 p8).


More information about the Gcc-bugs mailing list