has anybody come across the following error with gcc 3.4, boost 1.34.1 The conflicting code is along the lines of:
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 refers to an bool operator<( const Symbol& ) const member function, that compares two instances of type Symbol. This works fine on all compilers except gcc 3.4 where it cause the following internal compiler error.
/XYZ/include/XYZ/AAA/Type/Symbol.h:97: internal compiler error: in gen_subprogram_die, at dwarf2out.c:11278
I have been trying to find any pointer to the reason the above fails on the web, but could not find any solution. Has anybody come across this by any change ? Or has somebody a pointer to why the gcc compiler dies at that point ?
Thanks for any help.
/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
Try one of these:
My recommenation is option 1. The last official update to gcc3 I could find it 3.4.6 in March 2006. It is not going to get fixed any time soon.