This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]