This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/9282: compiler rejects to get function pointers to static member functions in template arguments
- From: bangerth at dealii dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, thor at math dot tu-berlin dot de
- Date: 13 Jan 2003 17:03:37 -0000
- Subject: Re: c++/9282: compiler rejects to get function pointers to static member functions in template arguments
- Reply-to: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, thor at math dot tu-berlin dot de, gcc-gnats at gcc dot gnu dot org
Synopsis: compiler rejects to get function pointers to static member functions in template arguments
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Mon Jan 13 09:03:34 2003
State-Changed-Why:
Confirmed. Here's a simpler testcase:
--------------------------------
struct CPU {
typedef int (*pfun)();
template <pfun step1>
static int dispatch() {
return (*step1)();
}
template<int displacement>
static int foo();
};
template int CPU::dispatch<&CPU::foo<2> > ();
-------------------------
I think it should compile, but does not:
tmp/g> /home/bangerth/bin/gcc-3.4-pre/bin/gcc -c x.cc
x.cc: In static member function `static int CPU::dispatch() [with int
(*step1)() = CPU::foo() [with int displacement = 2]]':
x.cc:13: instantiated from here
x.cc:6: error: no matching function for call to `CPU::foo()'
This has not worked at least since 2.95.
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9282