I get: $ cat s.cpp #include <string> $ g++ -c -fno-rtti -D_GLIBCXX_DEBUG s.cpp In file included from /usr/include/c++/4.3/debug/debug.h:155, from /usr/include/c++/4.3/bits/stl_algobase.h:76, from /usr/include/c++/4.3/bits/char_traits.h:46, from /usr/include/c++/4.3/string:47, from s.cpp:1: /usr/include/c++/4.3/debug/formatter.h: In constructor __gnu_debug::_Error_formatter::_Parameter::_Parameter(const __gnu_debug::_Safe_iterator<_Iterator, _Sequence>&, const char*, __gnu_debug::_Error_formatter::_Is_iterator): /usr/include/c++/4.3/debug/formatter.h:218: error: cannot use typeid with -fno-rtti /usr/include/c++/4.3/debug/formatter.h:224: error: cannot use typeid with -fno-rtti /usr/include/c++/4.3/debug/formatter.h: In constructor __gnu_debug::_Error_formatter::_Parameter::_Parameter(const _Type*&, const char*, __gnu_debug::_Error_formatter::_Is_iterator): /usr/include/c++/4.3/debug/formatter.h:247: error: cannot use typeid with -fno-rtti /usr/include/c++/4.3/debug/formatter.h: In constructor __gnu_debug::_Error_formatter::_Parameter::_Parameter(_Type*&, const char*, __gnu_debug::_Error_formatter::_Is_iterator): /usr/include/c++/4.3/debug/formatter.h:260: error: cannot use typeid with -fno-rtti /usr/include/c++/4.3/debug/formatter.h: In constructor __gnu_debug::_Error_formatter::_Parameter::_Parameter(const _Iterator&, const char*, __gnu_debug::_Error_formatter::_Is_iterator): /usr/include/c++/4.3/debug/formatter.h:273: error: cannot use typeid with -fno-rtti /usr/include/c++/4.3/debug/formatter.h: In constructor __gnu_debug::_Error_formatter::_Parameter::_Parameter(const __gnu_debug::_Safe_sequence<_Sequence>&, const char*, __gnu_debug::_Error_formatter::_Is_sequence): /usr/include/c++/4.3/debug/formatter.h:289: error: cannot use typeid with -fno-rtti /usr/include/c++/4.3/debug/formatter.h: In constructor __gnu_debug::_Error_formatter::_Parameter::_Parameter(const _Sequence&, const char*, __gnu_debug::_Error_formatter::_Is_sequence): /usr/include/c++/4.3/debug/formatter.h:298: error: cannot use typeid with -fno-rtti
Shouldn't uses of typeid in the library be guarded with #ifdef _GXX_RTTI, or something? I'm using g++ 4.3.2 on Debian lenny. -- Summary: -fno-rtti vs _GLIBCXX_DEBUG Product: gcc Version: 4.3.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jay dot foad at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40160