This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49637] template function overload incorrectly ambiguous
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 5 Jul 2011 19:48:31 +0000
- Subject: [Bug c++/49637] template function overload incorrectly ambiguous
- Auto-submitted: auto-generated
- References: <bug-49637-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49637
--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> 2011-07-05 19:48:14 UTC ---
(In reply to comment #8)
> OH. I think I see what you are saying here. I now think that you're saying
> "the partial ordering will try to deduce the arguments regardless of whether or
> not you tell it not to deduce it."
Not exactly. The deduction done in partial ordering is not the same as the
deduction done for the call itself; partial ordering tries to find template
arguments which will make one signature match the other. Here, deducing U =
int makes the first signature match the second, but T is only used in
non-deduced context, so we don't have a value for it. If typename were a
deduced context, we could deduce T = T and win.
It's not clear to me why partial ordering requires that we deduce values for
all used parameters anyway. I'm not sure what the EDG front end is doing here,
I guess I'll raise it with the committee.