summaryrefslogtreecommitdiff
path: root/boost/exception
diff options
context:
space:
mode:
Diffstat (limited to 'boost/exception')
-rw-r--r--boost/exception/N3757.hpp46
-rw-r--r--boost/exception/all.hpp2
-rw-r--r--boost/exception/current_exception_cast.hpp2
-rw-r--r--boost/exception/detail/attribute_noreturn.hpp17
-rw-r--r--boost/exception/detail/clone_current_exception.hpp11
-rw-r--r--boost/exception/detail/error_info_impl.hpp8
-rw-r--r--boost/exception/detail/exception_ptr.hpp17
-rw-r--r--boost/exception/detail/is_output_streamable.hpp2
-rw-r--r--boost/exception/detail/object_hex_dump.hpp2
-rw-r--r--boost/exception/detail/type_info.hpp18
-rw-r--r--boost/exception/diagnostic_information.hpp31
-rw-r--r--boost/exception/errinfo_errno.hpp2
-rw-r--r--boost/exception/exception.hpp8
-rw-r--r--boost/exception/get_error_info.hpp2
-rw-r--r--boost/exception/info.hpp25
-rw-r--r--boost/exception/info_tuple.hpp2
-rw-r--r--boost/exception/to_string.hpp7
-rw-r--r--boost/exception/to_string_stub.hpp10
18 files changed, 135 insertions, 77 deletions
diff --git a/boost/exception/N3757.hpp b/boost/exception/N3757.hpp
new file mode 100644
index 0000000000..23b06066b1
--- /dev/null
+++ b/boost/exception/N3757.hpp
@@ -0,0 +1,46 @@
+//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_9011016A11A711E3B46CD9FA6088709B
+#define UUID_9011016A11A711E3B46CD9FA6088709B
+#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
+
+#include <boost/exception/info.hpp>
+#include <boost/exception/get_error_info.hpp>
+
+namespace
+boost
+ {
+ //Here we're using the boost::error_info machinery to store the info in the exception
+ //object. Within the context of N3757, this is strictly an implementation detail.
+
+ template <class Tag>
+ inline
+ void
+ exception::
+ set( typename Tag::type const & v )
+ {
+ exception_detail::set_info(*this,error_info<Tag,typename Tag::type>(v));
+ }
+
+ template <class Tag>
+ inline
+ typename Tag::type const *
+ exception::
+ get() const
+ {
+ return get_error_info<error_info<Tag,typename Tag::type> >(*this);
+ }
+ }
+
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
+#endif
+#endif
diff --git a/boost/exception/all.hpp b/boost/exception/all.hpp
index 9ffe42a9d0..32eb15051f 100644
--- a/boost/exception/all.hpp
+++ b/boost/exception/all.hpp
@@ -5,7 +5,7 @@
#ifndef UUID_316FDA946C0D11DEA9CBAE5255D89593
#define UUID_316FDA946C0D11DEA9CBAE5255D89593
-#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)
diff --git a/boost/exception/current_exception_cast.hpp b/boost/exception/current_exception_cast.hpp
index af2f153113..5d81f00b00 100644
--- a/boost/exception/current_exception_cast.hpp
+++ b/boost/exception/current_exception_cast.hpp
@@ -5,7 +5,7 @@
#ifndef UUID_7E83C166200811DE885E826156D89593
#define UUID_7E83C166200811DE885E826156D89593
-#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)
diff --git a/boost/exception/detail/attribute_noreturn.hpp b/boost/exception/detail/attribute_noreturn.hpp
deleted file mode 100644
index ae9f031efe..0000000000
--- a/boost/exception/detail/attribute_noreturn.hpp
+++ /dev/null
@@ -1,17 +0,0 @@
-//Copyright (c) 2009 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_61531AB0680611DEADD5846855D89593
-#define UUID_61531AB0680611DEADD5846855D89593
-
-#if defined(_MSC_VER)
-#define BOOST_ATTRIBUTE_NORETURN __declspec(noreturn)
-#elif defined(__GNUC__)
-#define BOOST_ATTRIBUTE_NORETURN __attribute__((__noreturn__))
-#else
-#define BOOST_ATTRIBUTE_NORETURN
-#endif
-
-#endif
diff --git a/boost/exception/detail/clone_current_exception.hpp b/boost/exception/detail/clone_current_exception.hpp
index cc201b908d..6fc1374737 100644
--- a/boost/exception/detail/clone_current_exception.hpp
+++ b/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/boost/exception/detail/error_info_impl.hpp b/boost/exception/detail/error_info_impl.hpp
index a8d1aa79dd..12e601b556 100644
--- a/boost/exception/detail/error_info_impl.hpp
+++ b/boost/exception/detail/error_info_impl.hpp
@@ -5,7 +5,7 @@
#ifndef UUID_CE6983AC753411DDA764247956D89593
#define UUID_CE6983AC753411DDA764247956D89593
-#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)
@@ -25,8 +25,7 @@ boost
{
public:
- virtual std::string tag_typeid_name() const = 0;
- virtual std::string value_as_string() const = 0;
+ virtual std::string name_value_string() const = 0;
protected:
@@ -63,8 +62,7 @@ boost
private:
- std::string tag_typeid_name() const;
- std::string value_as_string() const;
+ std::string name_value_string() const;
value_type value_;
};
diff --git a/boost/exception/detail/exception_ptr.hpp b/boost/exception/detail/exception_ptr.hpp
index 5e5a2679b8..cac64e6ab3 100644
--- a/boost/exception/detail/exception_ptr.hpp
+++ b/boost/exception/detail/exception_ptr.hpp
@@ -5,7 +5,7 @@
#ifndef UUID_618474C2DE1511DEB74A388C56D89593
#define UUID_618474C2DE1511DEB74A388C56D89593
-#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)
@@ -21,6 +21,9 @@
#include <boost/exception/diagnostic_information.hpp>
#include <boost/exception/detail/type_info.hpp>
#include <boost/exception/detail/clone_current_exception.hpp>
+#ifndef BOOST_NO_RTTI
+#include <boost/core/demangle.hpp>
+#endif
#include <boost/shared_ptr.hpp>
#include <stdexcept>
#include <new>
@@ -31,7 +34,7 @@ namespace
boost
{
class exception_ptr;
- BOOST_ATTRIBUTE_NORETURN void rethrow_exception( exception_ptr const & );
+ BOOST_NORETURN void rethrow_exception( exception_ptr const & );
exception_ptr current_exception();
class
@@ -89,7 +92,7 @@ boost
std::string
to_string( original_exception_type const & x )
{
- return x.value()->name();
+ return core::demangle(x.value()->name());
}
#endif
@@ -118,10 +121,12 @@ boost
{
Exception ba;
exception_detail::clone_impl<Exception> c(ba);
+#ifndef BOOST_EXCEPTION_DISABLE
c <<
throw_function(BOOST_CURRENT_FUNCTION) <<
throw_file(__FILE__) <<
throw_line(__LINE__);
+#endif
static exception_ptr ep(shared_ptr<exception_detail::clone_base const>(new exception_detail::clone_impl<Exception>(c)));
return ep;
}
@@ -449,7 +454,7 @@ boost
return ret;
}
- BOOST_ATTRIBUTE_NORETURN
+ BOOST_NORETURN
inline
void
rethrow_exception( exception_ptr const & p )
@@ -467,7 +472,7 @@ boost
inline
std::string
- diagnostic_information( exception_ptr const & p )
+ diagnostic_information( exception_ptr const & p, bool verbose=true )
{
if( p )
try
@@ -477,7 +482,7 @@ boost
catch(
... )
{
- return current_exception_diagnostic_information();
+ return current_exception_diagnostic_information(verbose);
}
return "<empty>";
}
diff --git a/boost/exception/detail/is_output_streamable.hpp b/boost/exception/detail/is_output_streamable.hpp
index 743313c1ec..847f3484b8 100644
--- a/boost/exception/detail/is_output_streamable.hpp
+++ b/boost/exception/detail/is_output_streamable.hpp
@@ -5,7 +5,7 @@
#ifndef UUID_898984B4076411DD973EDFA055D89593
#define UUID_898984B4076411DD973EDFA055D89593
-#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)
diff --git a/boost/exception/detail/object_hex_dump.hpp b/boost/exception/detail/object_hex_dump.hpp
index ccf1bac3f7..53c8bf6f36 100644
--- a/boost/exception/detail/object_hex_dump.hpp
+++ b/boost/exception/detail/object_hex_dump.hpp
@@ -5,7 +5,7 @@
#ifndef UUID_6F463AC838DF11DDA3E6909F56D89593
#define UUID_6F463AC838DF11DDA3E6909F56D89593
-#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)
diff --git a/boost/exception/detail/type_info.hpp b/boost/exception/detail/type_info.hpp
index 92f846468c..b8c7d48bae 100644
--- a/boost/exception/detail/type_info.hpp
+++ b/boost/exception/detail/type_info.hpp
@@ -5,19 +5,17 @@
#ifndef UUID_C3E1741C754311DDB2834CCA55D89593
#define UUID_C3E1741C754311DDB2834CCA55D89593
-#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)
#pragma warning(push,1)
#endif
-#include <boost/detail/sp_typeinfo.hpp>
+#include <boost/core/typeinfo.hpp>
+#include <boost/core/demangle.hpp>
#include <boost/current_function.hpp>
#include <boost/config.hpp>
-#ifndef BOOST_NO_TYPEID
-#include <boost/units/detail/utility.hpp>
-#endif
#include <string>
namespace
@@ -31,7 +29,7 @@ boost
#ifdef BOOST_NO_TYPEID
return BOOST_CURRENT_FUNCTION;
#else
- return units::detail::demangle(typeid(T*).name());
+ return core::demangle(typeid(T*).name());
#endif
}
@@ -43,7 +41,7 @@ boost
#ifdef BOOST_NO_TYPEID
return BOOST_CURRENT_FUNCTION;
#else
- return units::detail::demangle(typeid(T).name());
+ return core::demangle(typeid(T).name());
#endif
}
@@ -53,10 +51,10 @@ boost
struct
type_info_
{
- detail::sp_typeinfo const * type_;
+ core::typeinfo const * type_;
explicit
- type_info_( detail::sp_typeinfo const & type ):
+ type_info_( core::typeinfo const & type ):
type_(&type)
{
}
@@ -71,7 +69,7 @@ boost
}
}
-#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_SP_TYPEID(T))
+#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_CORE_TYPEID(T))
#ifndef BOOST_NO_RTTI
#define BOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::boost::exception_detail::type_info_(typeid(x))
diff --git a/boost/exception/diagnostic_information.hpp b/boost/exception/diagnostic_information.hpp
index ef89d73144..305e8edd61 100644
--- a/boost/exception/diagnostic_information.hpp
+++ b/boost/exception/diagnostic_information.hpp
@@ -5,7 +5,7 @@
#ifndef UUID_0552D49838DD11DD90146B8956D89593
#define UUID_0552D49838DD11DD90146B8956D89593
-#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)
@@ -17,7 +17,7 @@
#include <boost/exception/info.hpp>
#include <boost/utility/enable_if.hpp>
#ifndef BOOST_NO_RTTI
-#include <boost/units/detail/utility.hpp>
+#include <boost/core/demangle.hpp>
#endif
#include <exception>
#include <sstream>
@@ -31,17 +31,17 @@ boost
namespace
exception_detail
{
- std::string diagnostic_information_impl( boost::exception const *, std::exception const *, bool );
+ std::string diagnostic_information_impl( boost::exception const *, std::exception const *, bool, bool );
}
inline
std::string
- current_exception_diagnostic_information()
+ current_exception_diagnostic_information( bool verbose=true)
{
boost::exception const * be=current_exception_cast<boost::exception const>();
std::exception const * se=current_exception_cast<std::exception const>();
if( be || se )
- return exception_detail::diagnostic_information_impl(be,se,true);
+ return exception_detail::diagnostic_information_impl(be,se,true,verbose);
else
return "No diagnostic information available.";
}
@@ -107,7 +107,7 @@ boost
inline
std::string
- diagnostic_information_impl( boost::exception const * be, std::exception const * se, bool with_what )
+ diagnostic_information_impl( boost::exception const * be, std::exception const * se, bool with_what, bool verbose )
{
if( !be && !se )
return "Unknown exception.";
@@ -125,7 +125,7 @@ boost
return wh;
}
std::ostringstream tmp;
- if( be )
+ if( be && verbose )
{
char const * const * f=get_error_info<throw_file>(*be);
int const * l=get_error_info<throw_line>(*be);
@@ -149,36 +149,37 @@ boost
}
}
#ifndef BOOST_NO_RTTI
- tmp << std::string("Dynamic exception type: ") <<
- units::detail::demangle((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se))).type_->name()) << '\n';
+ if ( verbose )
+ tmp << std::string("Dynamic exception type: ") <<
+ core::demangle((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se))).type_->name()) << '\n';
#endif
- if( with_what && se )
+ if( with_what && se && verbose )
tmp << "std::exception::what: " << wh << '\n';
if( be )
if( char const * s=exception_detail::get_diagnostic_information(*be,tmp.str().c_str()) )
if( *s )
- return s;
+ return std::string(s);
return tmp.str();
}
}
template <class T>
std::string
- diagnostic_information( T const & e )
+ diagnostic_information( T const & e, bool verbose=true )
{
- return exception_detail::diagnostic_information_impl(exception_detail::get_boost_exception(&e),exception_detail::get_std_exception(&e),true);
+ return exception_detail::diagnostic_information_impl(exception_detail::get_boost_exception(&e),exception_detail::get_std_exception(&e),true,verbose);
}
inline
char const *
- diagnostic_information_what( exception const & e ) throw()
+ diagnostic_information_what( exception const & e, bool verbose=true ) throw()
{
char const * w=0;
#ifndef BOOST_NO_EXCEPTIONS
try
{
#endif
- (void) exception_detail::diagnostic_information_impl(&e,0,false);
+ (void) exception_detail::diagnostic_information_impl(&e,0,false,verbose);
if( char const * di=exception_detail::get_diagnostic_information(e,0) )
return di;
else
diff --git a/boost/exception/errinfo_errno.hpp b/boost/exception/errinfo_errno.hpp
index ea74010c94..2cf7cabe56 100644
--- a/boost/exception/errinfo_errno.hpp
+++ b/boost/exception/errinfo_errno.hpp
@@ -5,7 +5,7 @@
#ifndef UUID_F0EE17BE6C1211DE87FF459155D89593
#define UUID_F0EE17BE6C1211DE87FF459155D89593
-#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)
diff --git a/boost/exception/exception.hpp b/boost/exception/exception.hpp
index 42d2787128..d762cf827e 100644
--- a/boost/exception/exception.hpp
+++ b/boost/exception/exception.hpp
@@ -5,7 +5,7 @@
#ifndef UUID_274DA366004E11DCB1DDFE2E56D89593
#define UUID_274DA366004E11DCB1DDFE2E56D89593
-#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)
@@ -207,6 +207,12 @@ boost
class
exception
{
+ //<N3757>
+ public:
+ template <class Tag> void set( typename Tag::type const & );
+ template <class Tag> typename Tag::type const * get() const;
+ //</N3757>
+
protected:
exception():
diff --git a/boost/exception/get_error_info.hpp b/boost/exception/get_error_info.hpp
index 046f05aeef..96be7632cb 100644
--- a/boost/exception/get_error_info.hpp
+++ b/boost/exception/get_error_info.hpp
@@ -5,7 +5,7 @@
#ifndef UUID_1A590226753311DD9E4CCF6156D89593
#define UUID_1A590226753311DD9E4CCF6156D89593
-#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)
diff --git a/boost/exception/info.hpp b/boost/exception/info.hpp
index 7b56076d7b..762a950f86 100644
--- a/boost/exception/info.hpp
+++ b/boost/exception/info.hpp
@@ -5,7 +5,7 @@
#ifndef UUID_8D22C4CA9CC811DCAA9133D256D89593
#define UUID_8D22C4CA9CC811DCAA9133D256D89593
-#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)
@@ -24,41 +24,40 @@ boost
{
template <class Tag,class T>
inline
- typename enable_if<has_to_string<T>,std::string>::type
- to_string( error_info<Tag,T> const & x )
+ std::string
+ error_info_name( error_info<Tag,T> const & x )
{
- return to_string(x.value());
+ return tag_type_name<Tag>();
}
template <class Tag,class T>
inline
- error_info<Tag,T>::
- error_info( value_type const & value ):
- value_(value)
+ std::string
+ to_string( error_info<Tag,T> const & x )
{
+ return '[' + error_info_name(x) + "] = " + to_string_stub(x.value()) + '\n';
}
template <class Tag,class T>
inline
error_info<Tag,T>::
- ~error_info() throw()
+ error_info( value_type const & value ):
+ value_(value)
{
}
template <class Tag,class T>
inline
- std::string
error_info<Tag,T>::
- tag_typeid_name() const
+ ~error_info() throw()
{
- return tag_type_name<Tag>();
}
template <class Tag,class T>
inline
std::string
error_info<Tag,T>::
- value_as_string() const
+ name_value_string() const
{
return to_string_stub(*this);
}
@@ -114,7 +113,7 @@ boost
for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i )
{
error_info_base const & x = *i->second;
- tmp << '[' << x.tag_typeid_name() << "] = " << x.value_as_string() << '\n';
+ tmp << x.name_value_string();
}
tmp.str().swap(diagnostic_info_str_);
}
diff --git a/boost/exception/info_tuple.hpp b/boost/exception/info_tuple.hpp
index bf1be15da2..70154fd278 100644
--- a/boost/exception/info_tuple.hpp
+++ b/boost/exception/info_tuple.hpp
@@ -5,7 +5,7 @@
#ifndef UUID_63EE924290FB11DC87BB856555D89593
#define UUID_63EE924290FB11DC87BB856555D89593
-#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)
diff --git a/boost/exception/to_string.hpp b/boost/exception/to_string.hpp
index 59bf83d4c0..68541d2b8c 100644
--- a/boost/exception/to_string.hpp
+++ b/boost/exception/to_string.hpp
@@ -5,7 +5,7 @@
#ifndef UUID_7E48761AD92811DC9011477D56D89593
#define UUID_7E48761AD92811DC9011477D56D89593
-#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)
@@ -19,11 +19,16 @@
namespace
boost
{
+ template <class T,class U>
+ std::string to_string( std::pair<T,U> const & );
+ std::string to_string( std::exception const & );
+
namespace
to_string_detail
{
template <class T>
typename disable_if<is_output_streamable<T>,char>::type to_string( T const & );
+ using boost::to_string;
template <class,bool IsOutputStreamable>
struct has_to_string_impl;
diff --git a/boost/exception/to_string_stub.hpp b/boost/exception/to_string_stub.hpp
index e41d369775..b6ab31cf86 100644
--- a/boost/exception/to_string_stub.hpp
+++ b/boost/exception/to_string_stub.hpp
@@ -5,7 +5,7 @@
#ifndef UUID_E788439ED9F011DCB181F25B55D89593
#define UUID_E788439ED9F011DCB181F25B55D89593
-#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)
@@ -101,6 +101,14 @@ boost
{
return exception_detail::to_string_dispatch::dispatch(x,s);
}
+
+ template <class T,class U,class Stub>
+ inline
+ std::string
+ to_string_stub( std::pair<T,U> const & x, Stub s )
+ {
+ return std::string("(") + to_string_stub(x.first,s) + ',' + to_string_stub(x.second,s) + ')';
+ }
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)