I think this is a candidate to backport to libstdc++-4.6.1. exception_ptr.h needs the forward declaration because it's included from <typeinfo> before <typeinfo> defines std::type_info.
Tested: `make check` in x86_64-unknown-linux-gnu/libstdc++-v3. The abi_check test fails, but also did before this change. libstdc++-v3/ChangeLog: 2011-03-31 Jeffrey Yasskin <jyass...@google.com> * libsupc++/exception_ptr.h: Forward-declare std::type_info. * libsupc++/nested_exception.h (__throw_with_nested): Remove a redundant default argument from std::__throw_with_nested. diff --git a/libstdc++-v3/libsupc++/exception_ptr.h b/libstdc++-v3/libsupc++/exception_ptr.h index ef826f6..26117cd 100644 --- a/libstdc++-v3/libsupc++/exception_ptr.h +++ b/libstdc++-v3/libsupc++/exception_ptr.h @@ -137,7 +137,7 @@ namespace std operator==(const exception_ptr&, const exception_ptr&) throw() __attribute__ ((__pure__)); - const type_info* + const class type_info* __cxa_exception_type() const throw() __attribute__ ((__pure__)); }; diff --git a/libstdc++-v3/libsupc++/nested_exception.h b/libstdc++-v3/libsupc++/nested_exception.h index 6a4f04e..d4804bb 100644 --- a/libstdc++-v3/libsupc++/nested_exception.h +++ b/libstdc++-v3/libsupc++/nested_exception.h @@ -117,7 +117,7 @@ namespace std // with a type that has an accessible nested_exception base. template<typename _Ex> inline void - __throw_with_nested(_Ex&& __ex, const nested_exception* = 0) + __throw_with_nested(_Ex&& __ex, const nested_exception*) { throw __ex; } template<typename _Ex> -- This patch is available for review at http://codereview.appspot.com/4341041