The shared_ptr implementation uses typeid and therefore fails to compile with -fno-rtti.
Perhaps the functionality can be reduced by #ifdef __GCC_RTTI? testcase: #include <tr1/memory> using namespace std::tr1; class A {}; int main() { shared_ptr<A> spA; } gcc info: g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/opt/gcctrunk/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /home/tom/svn/gcc/configure --prefix=/opt/gcctrunk --disable-sjlj-exceptions : (reconfigured) /home/tom/svn/gcc/configure --prefix=/opt/gcctrunk --disable-sjlj-exceptions Thread model: posix gcc version 4.5.0 20091105 (experimental) (GCC) -- Summary: shared_ptr can not be used with -fno-rtti Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tom dot deseyn at gmail dot com GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42019