This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/49637] template function overload incorrectly ambiguous


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]