The following code used to work with gcc-4.4.3.
The Comeau online compiler also accepts it.
But with the gcc-4.5 trunk, it is rejected as ambiguous.
template<typename T, typename U> void f(U&) { }
template<typename T, typename U> void f(T const&) { }
int main()
{
int a;
f<int, int const>(a);
}
This is a reduced test case from boost.phoenix.
I'm not completely sure if gcc-4.5 is now right or wrong. Please investigate.
--
Summary: Overloaded template functions became ambiguous
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sefi at s-e-f-i dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43559