Compare commits

...

19 Commits

Author SHA1 Message Date
f3b43b5679 Define boost::wrapexcept when BOOST_NO_EXCEPTIONS is defined, to enable boost::make_exception_ptr 2020-12-20 02:03:11 +02:00
397bc3d675 Merge branch 'fix-wrapexcept' of https://github.com/palebedev/throw_exception into feature/pr-18 2020-12-19 15:00:54 +02:00
6360fb6f36 Add make_exception_ptr_test2 2020-12-19 15:00:18 +02:00
bd5f6a255f Add make_exception_ptr_test 2020-12-19 14:58:04 +02:00
9f37f214ed Add .github/workflows 2020-12-19 14:13:33 +02:00
3144a406d4 Define boost::wrapexcept even when BOOST_EXCEPTION_DISABLE is defined.
Since Boost.Exception started using boost::wrapexcept in implementation
of boost::exception_ptr, we need to define it even when
BOOST_EXCEPTION_DISABLE is defined, otherwise it won't compile:

$ clang++ -DBOOST_EXCEPTION_DISABLE -w -x c++ \
  /usr/include/boost/exception_ptr.hpp -fsyntax-only
In file included from /usr/include/boost/exception_ptr.hpp:9:
/usr/include/boost/exception/detail/exception_ptr.hpp:87:49: error: use of
undeclared identifier 'wrapexcept'
        return exception_ptr(boost::make_shared<wrapexcept<E> >(cp));
                                                ^
1 error generated.
2020-12-18 01:45:19 +03:00
3d08795778 Update maintainer e-mail 2020-12-12 01:06:36 +02:00
e0e262cc01 Update appveyor.yml 2020-11-14 21:40:29 +02:00
da6f5420fe Remove manual boost_install call from CMakeLists.txt 2020-06-14 19:19:43 +03:00
924eb33335 Merge pull request #16 from eldiener/develop
Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74
2020-05-06 16:35:30 +03:00
37f7c5fd30 Add BOOST_OVERRIDE to clone() and rethrow() 2020-04-14 00:41:54 +03:00
a9ea585926 Merge branch 'develop' of https://github.com/eldiener/throw_exception into cppbuilder 2020-04-08 12:53:23 -04:00
548084bd4c Added #pragma clang system_header 2020-04-06 18:15:35 -07:00
237c7a35d6 Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers. 2020-03-23 14:35:01 -04:00
3cd085a324 Rename 'release history' to 'revision history' 2020-01-21 03:25:16 +02:00
50a43b9512 Use BOOST_INCLUDE_LIBRARIES=throw_exception in the CMake install test 2020-01-21 00:39:57 +02:00
e452a9ee16 Update .travis.yml 2020-01-09 16:06:37 +02:00
86e09cc261 Use Trusty for clang-3.5 2020-01-02 04:49:08 +02:00
914d5a2ad3 Update Travis to Xenial 2020-01-02 00:18:05 +02:00
14 changed files with 421 additions and 83 deletions

186
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,186 @@
name: CI
on:
pull_request:
push:
branches:
- master
- develop
- feature/**
env:
LIBRARY: throw_exception
UBSAN_OPTIONS: print_stacktrace=1
jobs:
posix:
strategy:
fail-fast: false
matrix:
include:
- toolset: gcc-4.7
cxxstd: "03,11"
os: ubuntu-16.04
install: g++-4.7
- toolset: gcc-4.8
cxxstd: "03,11"
os: ubuntu-16.04
install: g++-4.8
- toolset: gcc-4.9
cxxstd: "03,11"
os: ubuntu-16.04
install: g++-4.9
- toolset: gcc-5
cxxstd: "03,11,14,1z"
os: ubuntu-16.04
- toolset: gcc-6
cxxstd: "03,11,14,1z"
os: ubuntu-16.04
install: g++-6
- toolset: gcc-7
cxxstd: "03,11,14,17"
os: ubuntu-18.04
- toolset: gcc-8
cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04
- toolset: gcc-9
cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04
- toolset: gcc-10
cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04
- toolset: clang
compiler: clang++-3.5
cxxstd: "03,11,14"
os: ubuntu-16.04
install: clang-3.5
- toolset: clang
compiler: clang++-3.6
cxxstd: "03,11,14"
os: ubuntu-16.04
install: clang-3.6
- toolset: clang
compiler: clang++-3.7
cxxstd: "03,11,14"
os: ubuntu-16.04
install: clang-3.7
- toolset: clang
compiler: clang++-3.8
cxxstd: "03,11,14"
os: ubuntu-16.04
install: clang-3.8
- toolset: clang
compiler: clang++-3.9
cxxstd: "03,11,14"
os: ubuntu-16.04
install: clang-3.9
- toolset: clang
compiler: clang++-4.0
cxxstd: "03,11,14"
os: ubuntu-16.04
install: clang-4.0
- toolset: clang
compiler: clang++-5.0
cxxstd: "03,11,14,1z"
os: ubuntu-16.04
install: clang-5.0
- toolset: clang
compiler: clang++-6.0
cxxstd: "03,11,14,17"
os: ubuntu-18.04
- toolset: clang
compiler: clang++-7
cxxstd: "03,11,14,17"
os: ubuntu-18.04
install: clang-7
- toolset: clang
compiler: clang++-8
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
- toolset: clang
compiler: clang++-9
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
- toolset: clang
compiler: clang++-10
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
- toolset: clang
cxxstd: "03,11,14,17,2a"
os: macos-10.15
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- name: Install packages
if: matrix.install
run: sudo apt install ${{matrix.install}}
- name: Setup Boost
run: |
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
./bootstrap.sh
./b2 -d0 headers
- name: Create user-config.jam
if: matrix.compiler
run: |
echo "using ${{matrix.toolset}} : : ${{matrix.compiler}} ;" > ~/user-config.jam
- name: Run tests
run: |
cd ../boost-root
./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} variant=debug,release
windows:
strategy:
fail-fast: false
matrix:
include:
- toolset: msvc-14.1
cxxstd: "14,17,latest"
addrmd: 32,64
os: windows-2016
- toolset: msvc-14.2
cxxstd: "14,17,latest"
addrmd: 32,64
os: windows-2019
- toolset: gcc
cxxstd: "03,11,14,17,2a"
addrmd: 64
os: windows-2019
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- name: Setup Boost
shell: cmd
run: |
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
set BOOST_BRANCH=develop
if "%GITHUB_BASE_REF%" == "master" set BOOST_BRANCH=master
cd ..
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
cmd /c bootstrap
b2 -d0 headers
- name: Run tests
shell: cmd
run: |
cd ../boost-root
b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release

View File

@ -4,11 +4,7 @@
language: cpp
sudo: false
dist: trusty
python: "2.7"
dist: xenial
branches:
only:
@ -131,12 +127,12 @@ matrix:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-8
env: UBSAN=1 TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1 LINKFLAGS=-fuse-ld=gold
compiler: g++-9
env: UBSAN=1 TOOLSET=gcc COMPILER=g++-9 CXXSTD=03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1 LINKFLAGS=-fuse-ld=gold
addons:
apt:
packages:
- g++-8
- g++-9
sources:
- ubuntu-toolchain-r-test
@ -145,6 +141,7 @@ matrix:
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11
- os: linux
dist: trusty
compiler: /usr/bin/clang++
env: TOOLSET=clang COMPILER=/usr/bin/clang++ CXXSTD=03,11
addons:
@ -153,6 +150,7 @@ matrix:
- clang-3.3
- os: linux
dist: trusty
compiler: /usr/bin/clang++
env: TOOLSET=clang COMPILER=/usr/bin/clang++ CXXSTD=03,11
addons:
@ -161,13 +159,13 @@ matrix:
- clang-3.4
- os: linux
dist: trusty
compiler: clang++-3.5
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-3.5
- libstdc++-4.9-dev
sources:
- ubuntu-toolchain-r-test
@ -178,7 +176,16 @@ matrix:
apt:
packages:
- clang-3.6
- libstdc++-4.9-dev
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: clang++-3.7
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-3.7
sources:
- ubuntu-toolchain-r-test
@ -189,7 +196,6 @@ matrix:
apt:
packages:
- clang-3.8
- libstdc++-4.9-dev
sources:
- ubuntu-toolchain-r-test
@ -200,7 +206,6 @@ matrix:
apt:
packages:
- clang-3.9
- libstdc++-4.9-dev
sources:
- ubuntu-toolchain-r-test
@ -211,10 +216,8 @@ matrix:
apt:
packages:
- clang-4.0
- libstdc++-4.9-dev
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- os: linux
compiler: clang++-5.0
@ -223,10 +226,8 @@ matrix:
apt:
packages:
- clang-5.0
- libstdc++-4.9-dev
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
- os: linux
compiler: clang++-6.0
@ -237,7 +238,6 @@ matrix:
- clang-6.0
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-6.0
- os: linux
compiler: clang++-7
@ -248,7 +248,7 @@ matrix:
- clang-7
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-7
- llvm-toolchain-xenial-7
- os: linux
compiler: clang++-8
@ -259,10 +259,9 @@ matrix:
- clang-8
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-8
- llvm-toolchain-xenial-8
- os: linux
dist: xenial
compiler: clang++-9
env: TOOLSET=clang COMPILER=clang++-9 CXXSTD=03,11,14,17,2a
addons:
@ -275,17 +274,18 @@ matrix:
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- 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
compiler: clang++-8
env: UBSAN=1 TOOLSET=clang COMPILER=clang++-8 CXXSTD=03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1
addons:
apt:
packages:
- clang-6.0
- clang-8
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-6.0
- llvm-toolchain-xenial-8
- os: linux
dist: trusty
compiler: clang++-libc++
env: TOOLSET=clang COMPILER=clang++-libc++ CXXSTD=03,11,14,1z
addons:
@ -294,6 +294,7 @@ matrix:
- libc++-dev
- os: linux
dist: trusty
compiler: clang++-libc++
env: UBSAN=1 TOOLSET=clang COMPILER=clang++-libc++ CXXSTD=03,11,14,1z UBSAN_OPTIONS=print_stacktrace=1
addons:
@ -305,11 +306,15 @@ matrix:
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
- os: osx
compiler: clang++
env: UBSAN=1 TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z UBSAN_OPTIONS=print_stacktrace=1
- os: linux
env: CMAKE=1
script:
- mkdir __build__ && cd __build__
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_DEBUG=1 ..
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=throw_exception ..
- ctest --output-on-failure -R boost_throw_exception
- os: linux
@ -328,8 +333,9 @@ matrix:
- os: linux
env: CMAKE_INSTALL=1
script:
- pip install --user cmake
- mkdir __build__ && cd __build__
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_DEBUG=1 -DBOOST_INCLUDE_LIBRARIES="assert;config;throw_exception" -DCMAKE_INSTALL_PREFIX=~/.local ..
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=throw_exception -DCMAKE_INSTALL_PREFIX=~/.local ..
- cmake --build . --target install
- cd ../libs/throw_exception/test/cmake_install_test && mkdir __build__ && cd __build__
- cmake -DCMAKE_INSTALL_PREFIX=~/.local ..

View File

@ -16,13 +16,6 @@ target_link_libraries(boost_throw_exception
Boost::config
)
if(BOOST_SUPERPROJECT_VERSION)
include(BoostInstall)
boost_install(TARGETS boost_throw_exception HEADER_DIRECTORY include/)
endif()
if(BUILD_TESTING)
add_subdirectory(test)

View File

@ -15,17 +15,23 @@ branches:
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0,msvc-14.0
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0
ADDRMD: 32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
TOOLSET: msvc-12.0,msvc-14.0
ADDRMD: 32,64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOOLSET: msvc-14.1
CXXSTD: 14,17
ADDRMD: 32,64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOOLSET: clang-win
CXXSTD: 14,17
ADDRMD: 64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
TOOLSET: msvc-14.2
CXXSTD: 14,17
CXXSTD: 14,17,latest
ADDRMD: 32,64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
ADDPATH: C:\cygwin\bin;
TOOLSET: gcc

View File

@ -5,15 +5,15 @@ http://www.boost.org/LICENSE_1_0.txt
////
[#changes]
# Release History
# Revision History
:toc:
:toc-title:
:idprefix:
## Changes in Boost 1.73.0
## Changes in 1.73.0
* Added an overload of `throw_exception` that takes a `boost::source_location`
object.
NOTE: Projects using `BOOST_THROW_EXCEPTION` with exceptions disabled will need
to add a definition of this new overload.

View File

@ -16,13 +16,18 @@ namespace boost { template <class T> class shared_ptr; }
namespace boost { namespace exception_detail { using boost::shared_ptr; } }
#endif
#if defined(__GNUC__) && (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#if !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#if __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#ifdef __clang__
#pragma clang system_header
#endif
#ifdef _MSC_VER
#pragma warning(push,1)
#pragma warning(disable: 4265)
#endif
#endif
namespace
boost

View File

@ -20,60 +20,25 @@
// http://www.boost.org/libs/throw_exception
//
#include <boost/exception/exception.hpp>
#include <boost/assert/source_location.hpp>
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#include <exception>
#if !defined( BOOST_EXCEPTION_DISABLE ) && defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x593) )
#if !defined( BOOST_EXCEPTION_DISABLE ) && defined( BOOST_BORLANDC ) && BOOST_WORKAROUND( BOOST_BORLANDC, BOOST_TESTED_AT(0x593) )
# define BOOST_EXCEPTION_DISABLE
#endif
namespace boost
{
// All boost exceptions are required to derive from std::exception,
// to ensure compatibility with BOOST_NO_EXCEPTIONS.
inline void throw_exception_assert_compatibility( std::exception const & ) {}
} // namespace boost
#if defined( BOOST_NO_EXCEPTIONS )
namespace boost
{
BOOST_NORETURN void throw_exception( std::exception const & e ); // user defined
BOOST_NORETURN void throw_exception( std::exception const & e, boost::source_location const & loc ); // user defined
} // namespace boost
#elif defined( BOOST_EXCEPTION_DISABLE )
namespace boost
{
template<class E> BOOST_NORETURN void throw_exception( E const & e )
{
throw_exception_assert_compatibility( e );
throw e;
}
template<class E> BOOST_NORETURN void throw_exception( E const & e, boost::source_location const & )
{
throw_exception_assert_compatibility( e );
throw e;
}
} // namespace boost
#else // !defined( BOOST_NO_EXCEPTIONS ) && !defined( BOOST_EXCEPTION_DISABLE )
#include <boost/exception/exception.hpp>
namespace boost
{
#endif
// boost::wrapexcept<E>
@ -140,7 +105,7 @@ public:
set_info( *this, throw_function( loc.function_name() ) );
}
virtual boost::exception_detail::clone_base const * clone() const
virtual boost::exception_detail::clone_base const * clone() const BOOST_OVERRIDE
{
wrapexcept * p = new wrapexcept( *this );
deleter del = { p };
@ -151,14 +116,45 @@ public:
return p;
}
virtual void rethrow() const
virtual void rethrow() const BOOST_OVERRIDE
{
#if defined( BOOST_NO_EXCEPTIONS )
boost::throw_exception( *this );
#else
throw *this;
#endif
}
};
// All boost exceptions are required to derive from std::exception,
// to ensure compatibility with BOOST_NO_EXCEPTIONS.
inline void throw_exception_assert_compatibility( std::exception const & ) {}
// boost::throw_exception
#if !defined( BOOST_NO_EXCEPTIONS )
#if defined( BOOST_EXCEPTION_DISABLE )
template<class E> BOOST_NORETURN void throw_exception( E const & e )
{
throw_exception_assert_compatibility( e );
throw e;
}
template<class E> BOOST_NORETURN void throw_exception( E const & e, boost::source_location const & )
{
throw_exception_assert_compatibility( e );
throw e;
}
#else // defined( BOOST_EXCEPTION_DISABLE )
template<class E> BOOST_NORETURN void throw_exception( E const & e )
{
throw_exception_assert_compatibility( e );
@ -171,9 +167,11 @@ template<class E> BOOST_NORETURN void throw_exception( E const & e, boost::sourc
throw wrapexcept<E>( e, loc );
}
} // namespace boost
#endif // defined( BOOST_EXCEPTION_DISABLE )
#endif
#endif // !defined( BOOST_NO_EXCEPTIONS )
} // namespace boost
// BOOST_THROW_EXCEPTION

View File

@ -7,7 +7,7 @@
],
"maintainers": [
"Emil Dotchevski <emil -at- revergestudios.com>",
"Peter Dimov <pdimov -at- pdimov.com>"
"Peter Dimov <pdimov -at- gmail.com>"
],
"description": "A common infrastructure for throwing exceptions from Boost libraries.",
"category": [

View File

@ -37,3 +37,10 @@ run throw_from_library_test.cpp lib1_throw lib2_throw lib3_throw : : : <link>sha
run throw_exception_nx_test.cpp : : : <exception-handling>off ;
run throw_exception_nx_test2.cpp : : : <exception-handling>off ;
run throw_exception_nx_test3.cpp : : : <exception-handling>off ;
run make_exception_ptr_test.cpp ;
run make_exception_ptr_test2.cpp ;
run make_exception_ptr_nx_test.cpp : : : <exception-handling>off ;
run make_exception_ptr_nx_test2.cpp : : : <exception-handling>off ;

View File

@ -0,0 +1,40 @@
// Copyright 2020 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
# pragma warning(disable: 4577) // noexcept used without /EHsc
#endif
//#include <boost/exception_ptr.hpp>
#include <boost/throw_exception.hpp>
#include <boost/exception/exception.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>
typedef boost::shared_ptr<boost::exception_detail::clone_base const> exception_ptr;
template<class E> exception_ptr make_exception_ptr( E const& e )
{
return boost::make_shared< boost::wrapexcept<E> >( e );
}
class my_exception: public std::exception {};
int main()
{
::make_exception_ptr( my_exception() );
}
namespace boost
{
// shared_ptr needs this
void throw_exception( std::exception const & )
{
std::exit( 1 );
}
} // namespace boost

View File

@ -0,0 +1,42 @@
// Copyright 2020 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
# pragma warning(disable: 4577) // noexcept used without /EHsc
#endif
#define BOOST_EXCEPTION_DISABLE
//#include <boost/exception_ptr.hpp>
#include <boost/throw_exception.hpp>
#include <boost/exception/exception.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>
typedef boost::shared_ptr<boost::exception_detail::clone_base const> exception_ptr;
template<class E> exception_ptr make_exception_ptr( E const& e )
{
return boost::make_shared< boost::wrapexcept<E> >( e );
}
class my_exception: public std::exception {};
int main()
{
::make_exception_ptr( my_exception() );
}
namespace boost
{
// shared_ptr needs this
void throw_exception( std::exception const & )
{
std::exit( 1 );
}
} // namespace boost

View File

@ -0,0 +1,18 @@
// Copyright 2020 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
#endif
#include <boost/exception_ptr.hpp>
#include <boost/core/lightweight_test.hpp>
class my_exception: public std::exception {};
int main()
{
BOOST_TEST_THROWS( boost::rethrow_exception( boost::make_exception_ptr( my_exception() ) ), my_exception );
return boost::report_errors();
}

View File

@ -0,0 +1,20 @@
// Copyright 2020 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
#endif
#define BOOST_EXCEPTION_DISABLE
#include <boost/exception_ptr.hpp>
#include <boost/core/lightweight_test.hpp>
class my_exception: public std::exception {};
int main()
{
BOOST_TEST_THROWS( boost::rethrow_exception( boost::make_exception_ptr( my_exception() ) ), my_exception );
return boost::report_errors();
}

View File

@ -0,0 +1,17 @@
// Copyright 2020 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
# pragma warning(disable: 4577) // noexcept used without /EHsc
#endif
// Make sure that simple inclusion does not
// require boost::throw_exception to be defined
#include <boost/throw_exception.hpp>
int main()
{
}