c++/4672: [2003-01-03]Template parameter deduction fails for overloaded template functions.

Wolfgang Bangerth bangerth@ices.utexas.edu
Thu Apr 10 14:01:00 GMT 2003


> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4672
> 
> This is a 3.2/3.3 regression with respect to 2.95, where the code compiled
> correctly. Redux is:

Indeed, this is a regression in 3.2/3.3/3.4 introduced between 2.95 and 
3.0. I bumped the priority and adjusted the synopsis.
W.


> -------------------------------------------------------------
> 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]

-------------------------------------------------------------------------
Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                               www: http://www.ices.utexas.edu/~bangerth/




More information about the Gcc-bugs mailing list