public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/4672: [2003-01-03]Template parameter deduction fails for overloaded template functions.
@ 2003-04-10 3:06 Giovanni Bajo
0 siblings, 0 replies; 2+ messages in thread
From: Giovanni Bajo @ 2003-04-10 3:06 UTC (permalink / raw)
To: nathan; +Cc: gcc-prs
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: c++/4672: [2003-01-03]Template parameter deduction fails for overloaded template functions.
@ 2003-04-10 14:06 Wolfgang Bangerth
0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Bangerth @ 2003-04-10 14:06 UTC (permalink / raw)
To: nathan; +Cc: gcc-prs
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/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-04-10 14:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-10 3:06 c++/4672: [2003-01-03]Template parameter deduction fails for overloaded template functions Giovanni Bajo
2003-04-10 14:06 Wolfgang Bangerth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).