This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/9282: compiler rejects to get function pointers to static member functions in template arguments


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]