gpt4 book ai didi

c++ - 内部编译器错误 : segmentation fault with g++4. 3.5

转载 作者:IT老高 更新时间:2023-10-28 22:22:40 27 4
gpt4 key购买 nike

这里是代码

   //fail_.cpp
template< unsigned char X, class L>
class A {
public:
typedef void (A::*fptr)();
class B {
public: B(typename A< X, L> ::fptr );
};
};
template < unsigned char X, typename L >
A<X,L>::B::B ( fptr ) { }

g++ -c fail_.cpp给出

fail_.cpp:11: internal compiler error: Segmentation fault
Please submit a full bug report, with preprocessed source if appropriate.
See < file:///usr/share/doc/gcc-4.3/README.Bugs > for instructions.

在 g++4.3.5 中对我来说似乎是一个错误,g++4.4 及更高版本不会给出任何此类段错误。

你们怎么看?代码本身有问题吗?

最佳答案

我在 gcc 4.2 中看到了类似的失败。正如其他人所说,内部错误意味着编译器内部出现严重错误,这暗示这是您的代码错误。

它在 g++ 4.6 和 clang 3.0 中运行良好。

关于c++ - 内部编译器错误 : segmentation fault with g++4. 3.5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9818751/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com