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: "timothyjgiese at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 5 Jul 2011 15:41:32 +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 #3 from Timothy J Giese <timothyjgiese at gmail dot com> 2011-07-05 15:40:59 UTC ---
The original minimal test case also fails to compile with g++ 4.5.1.
I can confirm that the following compiles fine with g++ 4.6.0, 4.5.1, and
4.4.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.