示例代码如下:结构模板类
struct TEMP
{
int j;
TEMP()
{
j = 0;
}
};
template<typename T>
class classA
{
struct strA
{
long i;
strA():i(0) {}
};
static strA obj_str;
classA();
};
template<typename T>
classA<T>::classA()
{}
template<typename T>
classA<TEMP>::strA classA<TEMP>::obj_str;
int main()
{
return 0;
}
在编译的代码,我收到以下错误:
test1.cpp:32: internal compiler error: in import_export_decl, at cp/decl2.c:1970 Please submit a full bug report, with preprocessed source if appropriate. See http://bugzilla.redhat.com/bugzilla> for instructions. Preprocessed source stored into /tmp/ccUGE0GW.out file, please attach this to your bugreport.
我建立在x86_64的,红帽Linux的机器验证码,并且gcc版本是gcc版本4.1.2 20070626(Red Hat 4.1.2-14)
请注意此代码已经使用gcc 3.4.5版20051201(Red Hat 3.4.5-2)在i386- redhat-linux机器。
任何想法,为什么这是无法与海湾合作委员会4.1.2建立。
在此先感谢。
您提交了一份完整的错误报告吗?这就是错误告诉你要做的事情。您现在可以尝试使用不同的编译器[版本]。 – strager 2009-09-30 10:42:24
在这里发现了一个错误报告:http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24791 - 这看起来像是一个变种。 – 2009-09-30 10:57:26
内部编译器错误总是意味着编译器有问题,所以不要认为这是你的错。 – 2009-09-30 10:57:54