public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/950: Template lookup problem
@ 2002-11-20 23:36 Wolfgang Bangerth
0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Bangerth @ 2002-11-20 23:36 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/950; it has been noted by GNATS.
From: Wolfgang Bangerth <bangerth@apex68.ticam.utexas.edu>
To: gcc-gnats@gcc.gnu.org
Cc:
Subject: c++/950: Template lookup problem
Date: Thu, 14 Nov 2002 14:34:53 -0600
Re-confirmed with 3.3 CVS from 2002-11-10 and 3.2.1 pre from the same date.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/950: Template lookup problem
@ 2002-11-10 12:46 Wolfgang Bangerth
0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Bangerth @ 2002-11-10 12:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/950; it has been noted by GNATS.
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: gcc-bugs@gcc.gnu.org, <gcc-gnats@gcc.gnu.org>
Cc:
Subject: Re: c++/950: Template lookup problem
Date: Sun, 10 Nov 2002 14:46:04 -0600 (CST)
A reduced testcase for this one is
--------------------------------------------
struct B { void a (int n); };
struct D: public B {};
template <typename T> struct X {
template<typename Y>
static void foo (const Y&, void (T::*)(Y));
};
int main () {
int n = 3;
X<D>::foo(n, &D::a);
}
--------------------------------------
The error I get is this one:
x.cc: In function `int main()':
x.cc:11: error: no matching function for call to `X<D>::foo(int&, void
(B::*)(int))'
Thus, the compiler cannot find a match for X::foo, since &D::a is
immediately converted to &B::a, i.e. to a pointer to member function of
the _base_ class, although we have taken a p-t-m-f of the derived class. I
don't know what the standard says on this one, but at least the failure
mode is clear now.
The problem can be worked around using a temporary variable of type
void (D::*)(int)
or an explicit cast.
Regards
Wolfgang
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ticam.utexas.edu
www: http://www.ticam.utexas.edu/~bangerth
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/950: Template lookup problem
@ 2001-08-12 9:38 lerdsuwa
0 siblings, 0 replies; 3+ messages in thread
From: lerdsuwa @ 2001-08-12 9:38 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, peteb
Synopsis: Template lookup problem
State-Changed-From-To: open->analyzed
State-Changed-By: lerdsuwa
State-Changed-When: Sun Aug 12 09:38:00 2001
State-Changed-Why:
Confirm as a bug.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=950&database=gcc
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-11-14 20:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-20 23:36 c++/950: Template lookup problem Wolfgang Bangerth
-- strict thread matches above, loose matches on Subject: below --
2002-11-10 12:46 Wolfgang Bangerth
2001-08-12 9:38 lerdsuwa
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).