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: "redi 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 17:28:54 +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 #6 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-07-05 17:28:09 UTC ---
(In reply to comment #3)
> struct S { typedef int iterator; };
> template <typename T, typename U> void F( T, U ) {}
> template <typename T> void F( T, int ) {}
> int main()
> {
> S::iterator i(42);
> F< S::iterator >(i,1); // OK 4.6.0, 4.5.1, 4.4.3
> return 0;
> }
>
> Since this works, then (IMO) the original minimal test case should work as
> well.
But that's not the same, T can be deduced here.