[Bug c++/47765] Wrong template deduction
daniel.kruegler at googlemail dot com
gcc-bugzilla@gcc.gnu.org
Thu Sep 8 17:05:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47765
--- Comment #4 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2011-09-08 16:57:48 UTC ---
(In reply to comment #3)
In fact I expected that there is some implementation freedom which allows this
(I was thinking of 14.7.1 p6), but I still wonder: I have always understood
that 14.8.2 only applies, if *all* template arguments are provided:
p1: "When a function template specialization is referenced, all of the template
arguments shall have values."
p5: "[..] When all template arguments have been deduced or obtained from
default template arguments, all uses of template parameters in the template
parameter list of the template and the function type are replaced with the
corresponding deduced or default argument values. [..]"
Doesn't this indicate that
template<typename T, typename T2>
void foo(const A<T>& r);
must be rejected immediately in this case, because T2 is nowhere specified nor
deducible?
More information about the Gcc-bugs
mailing list