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

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


The following reply was made to PR c++/4672; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth@ices.utexas.edu>
To: Giovanni Bajo <giovannibajo@libero.it>
Cc: gcc-gnats@gcc.gnu.org, <sven@programmingresearch.ie>,
   <gcc-bugs@gcc.gnu.org>, <nathan@gcc.gnu.org>
Subject: Re: c++/4672: [2003-01-03]Template parameter deduction fails for
 overloaded template functions.
Date: Thu, 10 Apr 2003 09:01:17 -0500 (CDT)

 > 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-prs mailing list