GCC 3.4 内部编译器错误与 std::map.find
gcc 3.4 internal compiler error with std::map.find
有没有人在 gcc 3.4、boost 1.34.1 中遇到以下错误冲突的代码如下:
class Symbol
{
/// ...
bool operator<( const Symbol& rhs ) const;
};
typedef boost::function< double( const XYZ::Date& ) > F;
typedef std::map<Symbol, F> M;
M aMap; // properly instantiated
Symbol s; // properly instantied
M::const_iterator it = aMap.find( s ); // dies in this call, see below
Symbol.h:97 指的是一个布尔运算符<( const Symbol&) const 成员函数,比较符号类型的两个实例。这在除 gcc 3.4 之外的所有编译器上都运行良好它会导致以下内部编译器错误。
/XYZ/include/XYZ/AAA/Type/Symbol.h:97:内部编译器错误:在gen_subprogram_die中,在dwarf2out.c:11278
我一直试图找到指向上述在网络上失败的原因的任何指针,但找不到任何解决方案。有没有人遇到过这个变化?或者有人指出为什么 gcc 编译器在这一点上死亡?
感谢您的任何帮助。
/XYZ/AAA/Type/Symbol.h: In member function `bool XYZ::Symbol::operator<(const XYZ::Symbol&) const':
/XYZ/AAA/Type/Symbol.h:97:
instantiated from `bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = XYZ::Symbol]'
/usr/local/include/c++/3.4.5/bits/stl_tree.h:1125:
instantiated from
`typename std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::find(const _Key&) const
[with
_Key = XYZ::Symbol,
_Val = std::pair<const XYZ::Symbol, boost::function<double ()(const XYZ::Date&), std::allocator<void> > >,
_KeyOfValue = std::_Select1st<std::pair<const XYZ::Symbol, boost::function<double ()(const XYZ::Date&), std::allocator<void> > > >,
_Compare = std::less<XYZ::Symbol>,
_Alloc = std::allocator<std::pair<const XYZ::Symbol, boost::function<double ()(const XYZ::Date&), std::allocator<void> > > >
]'
/usr/local/include/c++/3.4.5/bits/stl_map.h:513:
instantiated from
`typename std::_Rb_tree<_Key, std::pair<const I, T>, std::_Select1st<std::pair<const I, T> >, _Compare, _Alloc>::const_iterator std::map<_Key, _Tp, _Compare, _Alloc>::find(const _Key&) const
[with
_Key = XYZ::Symbol,
_Tp = boost::function<double ()(const XYZ::Date&), std::allocator<void> >,
_Compare = std::less<XYZ::Symbol>,
_Alloc = std::allocator<std::pair<const XYZ::Symbol, boost::function<double ()(const XYZ::Date&), std::allocator<void> > > >
]'
AFunc.cpp:70: instantiated from here
/XYZ/include/XYZ/AAA/Type/Symbol.h:97: internal compiler error: in gen_subprogram_die, at dwarf2out.c:11278
尝试以下方法之一:
- 升级您的海湾合作委员会:)
- 尝试不同的编译器标志。 尝试
- 复制该头文件并尝试剥离 Symbol 类的声明,直到错误停止,然后从那里拿走它。 看看你是否可以在没有声明的情况下逃脱你正在编译的平台上。
- 如果您的目标是获取特定发行版的二进制文件,请尝试在虚拟机中创建该发行版的安装(如果您仍然可以获得它!),升级其 gcc 并使用它进行编译。
我的建议是选项1。 gcc3 的最后一次官方更新我可以在 3.4.6 年 2006 月找到它。 它不会很快得到修复。
相关文章:
- 如何导出包含具有"std::unique_ptr"值的"std::map"属性的
- 使用一个考虑到std::map中键值的滚动或换行的键
- 有没有办法对std::unordered_set、std::unrdered_map、std::set、std::map
- 将重物插入std::map
- 使用通用值初始化 std::map,不重复
- 仅包含可移动 std::map 的类的移动构造函数不起作用
- C++:当所有条目都保证是唯一时,替代 std::map
- 使用模板化的键类型定义 std::map,该键类型基于作为参数接收的函数
- 如果 KEY 是 std::list 或 std::vector 而不是值,那么 std::map 的默认行为是什么?
- C++如何创建 std::map
- 从其他容器中移动构造"std::map"
- 将 std::map::emplace 与返回 shared_ptr 的函数一起使用是否正确?
- C++中 std::map 的运行时复杂度是多少?
- 为什么在 std::map 上移动无法将元素从一个映射移动到另一个映射
- 使用重载 [] 运算符返回 std::map() 的可赋值
- std::map, std::unordered_map - 缩小初始值设定项列表中的转换范围
- C++ 使用枚举类对象分配 std::map 值
- 静态 std::map instatiation 在类的方法中调用构造函数吗?
- std::map:当元素不可默认构造时创建/替换元素
- Arduino编译器和STL:使用std::vector和std::map