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++/47765] Wrong template deduction


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?


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