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: "schaub.johannes at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 5 Jul 2011 16:36:51 +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
Johannes Schaub <schaub.johannes at googlemail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |schaub.johannes at
| |googlemail dot com
--- Comment #5 from Johannes Schaub <schaub.johannes at googlemail dot com> 2011-07-05 16:36:14 UTC ---
(In reply to comment #1)
> Created attachment 24686 [details]
> minimal test case
IMO this is ambiguous. When doing partial ordering, in both cases the 'T'
remains undeduced. Recall that partial ordering is, apart from stripping
parameters that have no corresponding argument in a function call context,
independent from the context of the ordering. So you cannot take the 'S' that
you passed explicitly into account. The spec says (FDIS, C++0x)
"In most cases, all template parameters must have values in order for deduction
to succeed, but for partial ordering purposes a template parameter may remain
without a value provided it is not used in the types being used for partial
ordering. [ Note: A template parameter used in a non-deduced context is
considered used. â end note ]"