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]

bug of g++



exact version of GCC: gcc version 3.2 20020903
system type :Red Hat Linux 8.0 3.2-7
options: 
complete command line: g++ temp-in-temp.cpp
compiler output:
  temp-in-temp.cpp: In function `void fun2(x&)':
  temp-in-temp.cpp:20: parse error before `>' token

#include <iostream>
using namespace std;

class x
{
public:
   template <class T> void fun1(void);
};

template <class T>
inline void x::fun1(void)
{
   cout << "this is fun1:" << sizeof(T) << endl;
}

template <class T>
void fun2(x &o)
{
    cout <<"this is fun2:"<< endl;
    o.fun1<T>();
}

int main(void)
{
   x instance;

   fun2<int>(instance);
}


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