`foo' is not a member of type `test<int>'...but it is!!

Marc Guiot mguiod@nortelnetworks.com
Fri May 19 08:35:00 GMT 2000


The version of g++ 2.96 (as the last night version) say :
testGcc2.cc: In instantiation of `test<int>':
testGcc2.cc:24:   instantiated from here
testGcc2.cc:19: `foo' is not a member of type `test<int>'
testGcc2.cc:19: template argument 2 is invalid

Is it illegal or a bug? (Sunpro CC5.0 assert)

template <class T, void (T::*f)()>
class CALL
{
  public :
    void call(T *t)
    {
      (t->*f)();
    }
};

template <class T>
class test
{
  public :
    void foo()
    {
    }
    CALL<test<T>, &test<T>::foo> c;
};

int main()
{
  test<int> te;
}


-- 
: Linux/C++ user :
: looking for the QWAN :
Marc Guiot du Doignon
marc.guiot@design-up.com


More information about the Gcc-bugs mailing list