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]

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


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

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