[Bug c++/56421] Non-matching overload produces template substitution error
kristian.spangsege at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Feb 22 18:05:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56421
--- Comment #5 from Kristian Spangsege <kristian.spangsege at gmail dot com> 2013-02-22 18:04:41 UTC ---
(In reply to comment #4)
> I think 13.3 [over.match] ¶2 and 13.3.1 [over.match.funcs] ¶7 say the function
> template specialization must be generated before the number of arguments is
> checked to see if the candidate function is viable.
Not so.
Function templates must not be instantiated unless the number of arguments
match.
[C++11: 13.3/2]:
- First, a subset of the candidate functions (those that have the proper number
of arguments and meet certain other conditions) is selected to form a set of
viable functions (13.3.2).
- Then the best viable function is selected based on the implicit conversion
sequences (13.3.3.1) needed to match each argument to the corresponding
parameter of each viable function.
[C++11: 13.3.1/7]:
In each case where a candidate is a function template, candidate function
template specializations are generated using template argument deduction
(14.8.3, 14.8.2). Those candidates are then handled as candidate functions in
the usual way.
More information about the Gcc-bugs
mailing list