c++/4672: [2003-01-03]Template parameter deduction fails for overloaded template functions.
Giovanni Bajo
giovannibajo@libero.it
Thu Apr 10 03:06:00 GMT 2003
The following reply was made to PR c++/4672; it has been noted by GNATS.
From: "Giovanni Bajo" <giovannibajo@libero.it>
To: <gcc-gnats@gcc.gnu.org>,
<sven@programmingresearch.ie>,
<gcc-bugs@gcc.gnu.org>,
<nathan@gcc.gnu.org>,
<gcc-prs@gcc.gnu.org>
Cc: "Wolfgang Bangerth" <bangerth@ices.utexas.edu>
Subject: Re: c++/4672: [2003-01-03]Template parameter deduction fails for overloaded template functions.
Date: Thu, 10 Apr 2003 05:02:10 +0200
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
r=4672
This is a 3.2/3.3 regression with respect to 2.95, where the code compiled
correctly. Redux is:
-------------------------------------------------------------
template<class T, class U> inline void Foo(U & from) {}
template<class T, class U> inline void Foo(U * from) {}
struct A
{
void foo () const
{
Foo<int>(this);
}
};
-------------------------------------------------------------
pr4672.cpp: In member function `void A::foo() const':
pr4672.cpp:8: error: call of overloaded `Foo(const A* const)' is ambiguous
pr4672.cpp:1: error: candidates are: void Foo(U&) [with T = int, U = const
A* const]
pr4672.cpp:2: error: void Foo(U*) [with T = int, U = const
A]
Notice that if you remove the (useless) template paramater T from Foo(), the
code compiles correctly. I would flag this regression as quite serious, too.
Please, somebody check it on 3.4 and see if it's still present (mainline is
still broken for cygwin).
Giovanni Bajo
More information about the Gcc-prs
mailing list