This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47765] Wrong template deduction
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 08 Sep 2011 16:57:48 +0000
- Subject: [Bug c++/47765] Wrong template deduction
- Auto-submitted: auto-generated
- References: <bug-47765-4@http.gcc.gnu.org/bugzilla/>
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?