gcc -v :
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --with-tune=i686
--enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
g++ -o a a.cpp
a.cpp: In function ¡®void func(T) [with T = int]¡¯:
a.cpp:19: instantiated from ¡®int CTemp::sta¡¯
a.cpp:19: instantiated from ¡®void func(T) [with T = int]¡¯
a.cpp:24: instantiated from here
a.cpp:19: internal compiler error: in instantiate_decl, at cp/pt.c:11775
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see .
Preprocessed source stored into /tmp/ccXG3CFA.out file, please attach this to
your bugreport.
Source File:
#include
using namespace std;
template < class T >
class CTemp{
private:
T element;
public:
CTemp (T arg):element(arg){ }
static int sta;
};
template int CTemp< int >::sta;
template < class T >
void func (T arg){
CTemp < T > a (arg);
int i;
cout << a.sta < int CTemp< int >::sta; make the
error
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: cxcxcxcx at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32308