diff --git a/include/boost/exception/detail/clone_current_exception.hpp b/include/boost/exception/detail/clone_current_exception.hpp index cc201b9..6fc1374 100644 --- a/include/boost/exception/detail/clone_current_exception.hpp +++ b/include/boost/exception/detail/clone_current_exception.hpp @@ -1,10 +1,16 @@ -//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2013 Emil Dotchevski and Reverge Studios, Inc. //Distributed under the Boost Software License, Version 1.0. (See accompanying //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef UUID_81522C0EB56511DFAB613DB0DFD72085 #define UUID_81522C0EB56511DFAB613DB0DFD72085 +#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif #ifdef BOOST_NO_EXCEPTIONS # error This header requires exception handling to be enabled. @@ -44,4 +50,7 @@ boost } } +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif #endif diff --git a/include/boost/exception/detail/exception_ptr.hpp b/include/boost/exception/detail/exception_ptr.hpp index b2ee365..ff2f677 100644 --- a/include/boost/exception/detail/exception_ptr.hpp +++ b/include/boost/exception/detail/exception_ptr.hpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -89,7 +90,7 @@ boost std::string to_string( original_exception_type const & x ) { - return x.value()->name(); + return units::detail::demangle(x.value()->name()); } #endif diff --git a/include/boost/throw_exception.hpp b/include/boost/throw_exception.hpp index c1bff43..200683e 100644 --- a/include/boost/throw_exception.hpp +++ b/include/boost/throw_exception.hpp @@ -1,6 +1,6 @@ #ifndef UUID_AA15E74A856F11E08B8D93F24824019B #define UUID_AA15E74A856F11E08B8D93F24824019B -#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) #pragma GCC system_header #endif #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) @@ -41,8 +41,11 @@ #if !defined( BOOST_EXCEPTION_DISABLE ) # include +#if !defined(BOOST_THROW_EXCEPTION_CURRENT_FUNCTION) # include -# define BOOST_THROW_EXCEPTION(x) ::boost::exception_detail::throw_exception_(x,BOOST_CURRENT_FUNCTION,__FILE__,__LINE__) +# define BOOST_THROW_EXCEPTION_CURRENT_FUNCTION BOOST_CURRENT_FUNCTION +#endif +# define BOOST_THROW_EXCEPTION(x) ::boost::exception_detail::throw_exception_(x,BOOST_THROW_EXCEPTION_CURRENT_FUNCTION,__FILE__,__LINE__) #else # define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x) #endif diff --git a/test/cloning_test.cpp b/test/cloning_test.cpp index ec10976..c5a4ae9 100644 --- a/test/cloning_test.cpp +++ b/test/cloning_test.cpp @@ -143,6 +143,8 @@ test_std_exception() #ifndef BOOST_NO_RTTI std::type_info const * const * t=boost::get_error_info(x); BOOST_TEST(t!=0 && *t!=0 && **t==typeid(T)); + std::string s=diagnostic_information(x); + BOOST_TEST(!s.empty()); #endif } catch( diff --git a/test/throw_exception_test.cpp b/test/throw_exception_test.cpp index 37ecef9..c6c0eeb 100644 --- a/test/throw_exception_test.cpp +++ b/test/throw_exception_test.cpp @@ -35,8 +35,8 @@ boost_throw_exception_test() catch( boost::exception & x ) { - char const * const * file=boost::get_error_info(x); - char const * const * function=boost::get_error_info(x); + char const * const * function=boost::get_error_info(x); + char const * const * file=boost::get_error_info(x); int const * line=boost::get_error_info(x); BOOST_TEST( file && *file ); BOOST_TEST( function && *function ); @@ -55,8 +55,8 @@ boost_throw_exception_test() catch( boost::exception & x ) { - char const * const * file=boost::get_error_info(x); - char const * const * function=boost::get_error_info(x); + char const * const * function=boost::get_error_info(x); + char const * const * file=boost::get_error_info(x); int const * line=boost::get_error_info(x); int const * data=boost::get_error_info(x); BOOST_TEST( file && *file );