This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
bug of g++
- From: Chin-Lung Chang <evirt at iis dot sinica dot edu dot tw>
- To: bug-gcc at gnu dot org
- Date: 13 Dec 2002 16:55:29 +0800
- Subject: 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);
}