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)
Seems like a reasonable request, it will disable at least the get_deleter() functionality. I'll work on this when I update shared_ptr to match the latest WP
Created attachment 19031 [details] proposed patch I'm testing this, with and without -fno-rtti Without rtti 20_util/shared_ptr/cons/unique_ptr_deleter_ref_2.cc fails as expected
Subject: Bug 42019 Author: redi Date: Fri Nov 20 21:23:02 2009 New Revision: 154377 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154377 Log: 2009-11-20 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42019 * include/tr1/shared_ptr.h: Only use typeid when RTTI is enabled. * include/bits/shared_ptr_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * testsuite/tr1/2_general_utilities/shared_ptr/misc/42019.cc: New. * testsuite/20_util/shared_ptr/misc/42019.cc: New. Added: trunk/libstdc++-v3/testsuite/20_util/shared_ptr/misc/42019.cc trunk/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/42019.cc Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/include/bits/shared_ptr.h trunk/libstdc++-v3/include/bits/shared_ptr_base.h trunk/libstdc++-v3/include/tr1/shared_ptr.h
Fixed for 4.5.0