Compare commits

..

9 Commits

5 changed files with 63 additions and 8 deletions

View File

@ -110,7 +110,7 @@ matrix:
- os: linux
compiler: g++-8
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11,14,17
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11,14,17,2a
addons:
apt:
packages:
@ -120,7 +120,7 @@ matrix:
- os: linux
compiler: g++-8
env: UBSAN=1 TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11,14,17 UBSAN_OPTIONS=print_stacktrace=1 LINKFLAGS=-fuse-ld=gold
env: UBSAN=1 TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1 LINKFLAGS=-fuse-ld=gold
addons:
apt:
packages:
@ -227,6 +227,17 @@ matrix:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-6.0
- os: linux
compiler: clang++-7
env: TOOLSET=clang COMPILER=clang++-7 CXXSTD=03,11,14,17,2a
addons:
apt:
packages:
- clang-7
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-7
- os: linux
compiler: clang++-6.0
env: UBSAN=1 TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=03,11,14,17 UBSAN_OPTIONS=print_stacktrace=1
@ -263,8 +274,6 @@ install:
- cd ..
- git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update --init tools/build
- git submodule update --init libs/config
- git submodule update --init tools/boostdep
- cp -r $TRAVIS_BUILD_DIR/* libs/throw_exception
- python tools/boostdep/depinst/depinst.py throw_exception

View File

@ -2,6 +2,9 @@
# 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
# Partial (add_subdirectory only) and experimental CMake support
# Subject to change; please do not rely on the contents of this file yet
cmake_minimum_required(VERSION 3.5)
project(BoostThrowException LANGUAGES CXX)

View File

@ -44,10 +44,8 @@ install:
- cd ..
- git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update --init tools/build
- git submodule update --init libs/config
- git submodule update --init tools/boostdep
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\throw_exception
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\throw_exception\
- python tools/boostdep/depinst/depinst.py throw_exception
- cmd /c bootstrap
- b2 -d0 headers

View File

@ -472,6 +472,51 @@ boost
{
return exception_detail::clone_impl<T>(x);
}
template <class T>
struct
BOOST_SYMBOL_VISIBLE
wrapexcept:
public exception_detail::clone_impl<typename exception_detail::enable_error_info_return_type<T>::type>
{
typedef exception_detail::clone_impl<typename exception_detail::enable_error_info_return_type<T>::type> base_type;
public:
explicit
wrapexcept( typename exception_detail::enable_error_info_return_type<T>::type const & x ):
base_type( x )
{
}
~wrapexcept() throw()
{
}
};
namespace
exception_detail
{
template <class T>
struct
remove_error_info_injector
{
typedef T type;
};
template <class T>
struct
remove_error_info_injector< error_info_injector<T> >
{
typedef T type;
};
template <class T>
inline
wrapexcept<typename remove_error_info_injector<T>::type>
enable_both( T const & x )
{
return wrapexcept<typename remove_error_info_injector<T>::type>( enable_error_info( x ) );
}
}
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)

View File

@ -67,7 +67,7 @@ template<class E> BOOST_NORETURN inline void throw_exception( E const & e )
throw_exception_assert_compatibility(e);
#ifndef BOOST_EXCEPTION_DISABLE
throw enable_current_exception(enable_error_info(e));
throw exception_detail::enable_both( e );
#else
throw e;
#endif