mirror of
https://github.com/boostorg/exception.git
synced 2025-07-30 20:47:18 +02:00
Merge branch 'develop'
This commit is contained in:
368
.travis.yml
368
.travis.yml
@ -1,5 +1,5 @@
|
|||||||
# Copyright 2017 Emil Dotchevski
|
# Copyright 2016-2018 Peter Dimov
|
||||||
# Copyright 2016 Peter Dimov
|
# Copyright 2018-2019 Emil Dotchevski
|
||||||
# Distributed under the Boost Software License, Version 1.0.
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
@ -7,6 +7,8 @@ language: cpp
|
|||||||
|
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
|
dist: trusty
|
||||||
|
|
||||||
python: "2.7"
|
python: "2.7"
|
||||||
|
|
||||||
os:
|
os:
|
||||||
@ -17,6 +19,7 @@ branches:
|
|||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
- develop
|
- develop
|
||||||
|
- /^feature.*/
|
||||||
|
|
||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
@ -25,14 +28,16 @@ env:
|
|||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- g++-4.7
|
|
||||||
- g++-4.8
|
|
||||||
- g++-4.9
|
- g++-4.9
|
||||||
- g++-5
|
- g++-5
|
||||||
- g++-6
|
- g++-6
|
||||||
- clang-3.6
|
- clang-3.6
|
||||||
- clang-3.7
|
- clang-3.7
|
||||||
- clang-3.8
|
- clang-3.8
|
||||||
|
- ruby-full
|
||||||
|
# - python-3.6
|
||||||
|
- ninja-build
|
||||||
|
|
||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
- llvm-toolchain-precise
|
- llvm-toolchain-precise
|
||||||
@ -46,53 +51,348 @@ matrix:
|
|||||||
- env: BOGUS_JOB=true
|
- env: BOGUS_JOB=true
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- os: linux
|
|
||||||
env: TOOLSET=gcc COMPILER=g++ CXXSTD=c++0x
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=c++0x
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=c++0x
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=c++0x
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++0x
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++0x
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=c++0x
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=c++0x
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++0x
|
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++0x
|
osx_image: xcode11.2
|
||||||
|
compiler: clang++
|
||||||
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode11.1
|
||||||
|
compiler: clang++
|
||||||
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode11
|
||||||
|
compiler: clang++
|
||||||
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode10.3
|
||||||
|
compiler: clang++
|
||||||
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode10.2
|
||||||
|
compiler: clang++
|
||||||
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode10.1
|
||||||
|
compiler: clang++
|
||||||
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode10
|
||||||
|
compiler: clang++
|
||||||
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode9.4
|
||||||
|
compiler: clang++
|
||||||
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode9.3
|
||||||
|
compiler: clang++
|
||||||
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode9.2
|
||||||
|
compiler: clang++
|
||||||
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode9.1
|
||||||
|
compiler: clang++
|
||||||
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode9
|
||||||
|
compiler: clang++
|
||||||
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode8.3
|
||||||
|
compiler: clang++
|
||||||
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode8
|
||||||
|
compiler: clang++
|
||||||
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
compiler: clang++
|
||||||
|
env: UBSAN=1 TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z UBSAN_OPTIONS=print_stacktrace=1
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: g++-4.7
|
||||||
|
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=98,03,11
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- g++-4.7
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: g++-4.8
|
||||||
|
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=98,03,11
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- g++-4.8
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: g++-4.9
|
||||||
|
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=98,03,11
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- g++-4.9
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: g++-5
|
||||||
|
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=98,03,11,14,1z
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- g++-5
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: g++-6
|
||||||
|
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=98,03,11,14,1z
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- g++-6
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: g++-7
|
||||||
|
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=98,03,11,14,17
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- g++-7
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: g++-8
|
||||||
|
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=98,03,11,14,17
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- g++-8
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: g++-9
|
||||||
|
env: TOOLSET=gcc COMPILER=g++-9 CXXSTD=98,03,11,14,17,2a
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- g++-9
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: g++-9
|
||||||
|
env: UBSAN=1 TOOLSET=gcc COMPILER=g++-9 CXXSTD=98,03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1 LINKFLAGS=-fuse-ld=gold
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- g++-9
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: /usr/bin/clang++
|
||||||
|
env: TOOLSET=clang COMPILER=/usr/bin/clang++ CXXSTD=98,03,11
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-3.3
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: /usr/bin/clang++
|
||||||
|
env: TOOLSET=clang COMPILER=/usr/bin/clang++ CXXSTD=98,03,11
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-3.4
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: clang++
|
||||||
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: clang++-3.5
|
||||||
|
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=98,03,11,14,1z
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-3.5
|
||||||
|
- libstdc++-4.9-dev
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: clang++-3.6
|
||||||
|
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=98,03,11,14,1z
|
||||||
|
addons:
|
||||||
|
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=98,03,11,14,1z
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-3.7
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
- llvm-toolchain-precise-3.7
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: clang++-3.8
|
||||||
|
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=98,03,11,14,1z
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-3.8
|
||||||
|
- libstdc++-4.9-dev
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: clang++-3.9
|
||||||
|
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=98,03,11,14,1z
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-3.9
|
||||||
|
- libstdc++-4.9-dev
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: clang++-4.0
|
||||||
|
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=98,03,11,14,1z
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-4.0
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
- llvm-toolchain-trusty-4.0
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: clang++-5.0
|
||||||
|
env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=98,03,11,14,1z
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-5.0
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
- llvm-toolchain-trusty-5.0
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: clang++-6.0
|
||||||
|
env: TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=98,03,11,14,17
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-6.0
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
- llvm-toolchain-trusty-6.0
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: clang++-7
|
||||||
|
env: TOOLSET=clang COMPILER=clang++-7 CXXSTD=98,03,11,14,17,2a
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-7
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
- llvm-toolchain-trusty-7
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: clang++-8
|
||||||
|
env: TOOLSET=clang COMPILER=clang++-8 CXXSTD=98,03,11,14,17,2a
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-8
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
- llvm-toolchain-trusty-8
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
dist: xenial
|
||||||
|
compiler: clang++-9
|
||||||
|
env: TOOLSET=clang COMPILER=clang++-9 CXXSTD=98,03,11,14,17,2a
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-9
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
|
||||||
|
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: clang++-8
|
||||||
|
env: UBSAN=1 TOOLSET=clang COMPILER=clang++-8 CXXSTD=98,03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-8
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
- llvm-toolchain-trusty-8
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
- gem install asciidoctor
|
||||||
|
- gem install coderay
|
||||||
- cd ..
|
- cd ..
|
||||||
- git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
- git clone -b master --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||||
- cd boost-root
|
- cd boost-root
|
||||||
- git submodule update --init tools/build
|
- git submodule update --init tools/build
|
||||||
- git submodule update --init tools/inspect
|
- git submodule update --init tools/inspect
|
||||||
- git submodule update --init libs/config
|
- git submodule update --init libs/config
|
||||||
- git submodule update --init tools/boostdep
|
- git submodule update --init tools/boostdep
|
||||||
|
- rm -rf libs/exception
|
||||||
|
- mkdir libs/exception
|
||||||
- cp -r $TRAVIS_BUILD_DIR/* libs/exception
|
- cp -r $TRAVIS_BUILD_DIR/* libs/exception
|
||||||
- python tools/boostdep/depinst/depinst.py exception
|
- python tools/boostdep/depinst/depinst.py exception
|
||||||
- ./bootstrap.sh
|
- ./bootstrap.sh
|
||||||
- ./b2 headers
|
- ./b2 headers
|
||||||
|
- cd libs/exception
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- |-
|
- |-
|
||||||
echo "using $TOOLSET : : $COMPILER : <cxxflags>-std=$CXXSTD ;" > ~/user-config.jam
|
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
|
||||||
- ./b2 libs/exception/test toolset=$TOOLSET
|
- ../../b2 test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${UBSAN:+cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined linkflags=-fsanitize=undefined debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS}
|
||||||
|
- ../../b2 exception-handling=off rtti=off test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${UBSAN:+cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined linkflags=-fsanitize=undefined debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS}
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
|
@ -38,7 +38,7 @@ boost
|
|||||||
<p>Nothing.</p>
|
<p>Nothing.</p>
|
||||||
<h4>Notes:</h4>
|
<h4>Notes:</h4>
|
||||||
<div><ul><li> It is unspecified whether the return values of two successive calls to <span class="RenoLink">current_exception</span> refer to the same exception object.</li>
|
<div><ul><li> It is unspecified whether the return values of two successive calls to <span class="RenoLink">current_exception</span> refer to the same exception object.</li>
|
||||||
<li> Correct implementation of <span class="RenoLink">current_exception</span> may require compiler support, unless <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> was used at the time the currently handled exception object was passed to throw. Whenever <span class="RenoLink">current_exception</span> fails to properly copy the current exception object, it returns an <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> to an object of type that is as close as possible to the original exception type, using <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span> as a final fallback. All such types derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, and:<div><ul><li> if the original exception object derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, then the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> sub-object of the object referred to by the returned <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> is initialized by the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> copy constructor;</li>
|
<li> Correct implementation of <span class="RenoLink">current_exception</span> may require compiler support (e.g. C++11 <a href="https://en.cppreference.com/w/cpp/error/current_exception">std::current_exception()</a> is used when available, as specified by Boost.Config BOOST_NO_CXX11_HDR_EXCEPTION), unless <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> was used at the time the currently handled exception object was passed to throw. Whenever <span class="RenoLink">current_exception</span> fails to properly copy the current exception object, it returns an <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> to an object of type that is as close as possible to the original exception type, using <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span> as a final fallback. All such types derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, and:<div><ul><li> if the original exception object derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, then the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> sub-object of the object referred to by the returned <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> is initialized by the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> copy constructor;</li>
|
||||||
<li> if available, the exception contains the std::type_info of the original exception object, accessible through <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span><<span class="RenoLink"><a href="original_exception_type.html">original_exception_type</a></span>>.</li>
|
<li> if available, the exception contains the std::type_info of the original exception object, accessible through <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span><<span class="RenoLink"><a href="original_exception_type.html">original_exception_type</a></span>>.</li>
|
||||||
</ul></div>
|
</ul></div>
|
||||||
</li>
|
</li>
|
||||||
|
@ -299,6 +299,14 @@ boost
|
|||||||
return boost::copy_exception(unknown_exception(e));
|
return boost::copy_exception(unknown_exception(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
|
||||||
|
struct
|
||||||
|
std_exception_ptr_wrapper
|
||||||
|
{
|
||||||
|
std::exception_ptr p;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
inline
|
inline
|
||||||
exception_ptr
|
exception_ptr
|
||||||
current_exception_impl()
|
current_exception_impl()
|
||||||
@ -412,11 +420,14 @@ boost
|
|||||||
{
|
{
|
||||||
return exception_detail::current_exception_std_exception(e);
|
return exception_detail::current_exception_std_exception(e);
|
||||||
}
|
}
|
||||||
|
#ifdef BOOST_NO_CXX11_HDR_EXCEPTION
|
||||||
|
// this case can be handled losslesly with std::current_exception() (see below)
|
||||||
catch(
|
catch(
|
||||||
std::exception & e )
|
std::exception & e )
|
||||||
{
|
{
|
||||||
return exception_detail::current_exception_unknown_std_exception(e);
|
return exception_detail::current_exception_unknown_std_exception(e);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
catch(
|
catch(
|
||||||
boost::exception & e )
|
boost::exception & e )
|
||||||
{
|
{
|
||||||
@ -425,8 +436,23 @@ boost
|
|||||||
catch(
|
catch(
|
||||||
... )
|
... )
|
||||||
{
|
{
|
||||||
|
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// wrap the std::exception_ptr in a clone-enabled Boost.Exception object
|
||||||
|
exception_detail::clone_base const & base =
|
||||||
|
boost::enable_current_exception(std_exception_ptr_wrapper{std::current_exception()});
|
||||||
|
return exception_ptr(shared_ptr<exception_detail::clone_base const>(base.clone()));
|
||||||
|
}
|
||||||
|
catch(
|
||||||
|
...)
|
||||||
|
{
|
||||||
return exception_detail::current_exception_unknown_exception();
|
return exception_detail::current_exception_unknown_exception();
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
return exception_detail::current_exception_unknown_exception();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -461,7 +487,20 @@ boost
|
|||||||
rethrow_exception( exception_ptr const & p )
|
rethrow_exception( exception_ptr const & p )
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(p);
|
BOOST_ASSERT(p);
|
||||||
|
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
|
||||||
|
try
|
||||||
|
{
|
||||||
p.ptr_->rethrow();
|
p.ptr_->rethrow();
|
||||||
|
}
|
||||||
|
catch(
|
||||||
|
exception_detail::std_exception_ptr_wrapper const & wrp)
|
||||||
|
{
|
||||||
|
// if an std::exception_ptr was wrapped above then rethrow it
|
||||||
|
std::rethrow_exception(wrp.p);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
p.ptr_->rethrow();
|
||||||
|
#endif
|
||||||
BOOST_ASSERT(0);
|
BOOST_ASSERT(0);
|
||||||
#if defined(UNDER_CE)
|
#if defined(UNDER_CE)
|
||||||
// some CE platforms don't define ::abort()
|
// some CE platforms don't define ::abort()
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#define BOOST_NO_EXCEPTIONS
|
#define BOOST_NO_EXCEPTIONS
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
class my_exception: public std::exception { };
|
class my_exception: public std::exception { };
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#define BOOST_NO_EXCEPTIONS
|
#define BOOST_NO_EXCEPTIONS
|
||||||
#define BOOST_EXCEPTION_DISABLE
|
#define BOOST_EXCEPTION_DISABLE
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
class my_exception: public std::exception { };
|
class my_exception: public std::exception { };
|
||||||
|
|
||||||
|
@ -38,6 +38,25 @@ throw_unknown_exception()
|
|||||||
throw test_exception();
|
throw test_exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct
|
||||||
|
user_defined_exception
|
||||||
|
{
|
||||||
|
user_defined_exception(int d):data(d){}
|
||||||
|
int data;
|
||||||
|
};
|
||||||
|
|
||||||
|
void
|
||||||
|
throw_user_defined_exception()
|
||||||
|
{
|
||||||
|
throw user_defined_exception(42);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
throw_builtin_exception()
|
||||||
|
{
|
||||||
|
throw 42;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
@ -138,5 +157,115 @@ main()
|
|||||||
BOOST_TEST(false);
|
BOOST_TEST(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
throw_user_defined_exception();
|
||||||
|
}
|
||||||
|
catch(
|
||||||
|
... )
|
||||||
|
{
|
||||||
|
boost::exception_ptr ep=boost::current_exception();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
rethrow_exception(ep);
|
||||||
|
}
|
||||||
|
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
|
||||||
|
catch(
|
||||||
|
user_defined_exception & x)
|
||||||
|
{
|
||||||
|
//Yay! std::current_exception to the rescue!
|
||||||
|
BOOST_TEST( 42==x.data );
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
catch(
|
||||||
|
boost::unknown_exception & )
|
||||||
|
{
|
||||||
|
//Boo! user defined exception was transported as a boost::unknown_exception
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
catch(
|
||||||
|
... )
|
||||||
|
{
|
||||||
|
BOOST_TEST(false);
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
rethrow_exception(ep);
|
||||||
|
}
|
||||||
|
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
|
||||||
|
catch(
|
||||||
|
user_defined_exception & x)
|
||||||
|
{
|
||||||
|
//Yay! std::current_exception to the rescue!
|
||||||
|
BOOST_TEST( 42==x.data );
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
catch(
|
||||||
|
boost::unknown_exception & )
|
||||||
|
{
|
||||||
|
//Boo! user defined exception was transported as a boost::unknown_exception
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
catch(
|
||||||
|
... )
|
||||||
|
{
|
||||||
|
BOOST_TEST(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
throw_builtin_exception();
|
||||||
|
}
|
||||||
|
catch(
|
||||||
|
... )
|
||||||
|
{
|
||||||
|
boost::exception_ptr ep=boost::current_exception();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
rethrow_exception(ep);
|
||||||
|
}
|
||||||
|
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
|
||||||
|
catch(
|
||||||
|
int & x)
|
||||||
|
{
|
||||||
|
//Yay! std::current_exception to the rescue!
|
||||||
|
BOOST_TEST( 42==x );
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
catch(
|
||||||
|
boost::unknown_exception & )
|
||||||
|
{
|
||||||
|
//Boo! builtin exception was transported as a boost::unknown_exception
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
catch(
|
||||||
|
... )
|
||||||
|
{
|
||||||
|
BOOST_TEST(false);
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
rethrow_exception(ep);
|
||||||
|
}
|
||||||
|
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
|
||||||
|
catch(
|
||||||
|
int & x)
|
||||||
|
{
|
||||||
|
//Yay! std::current_exception to the rescue!
|
||||||
|
BOOST_TEST( 42==x );
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
catch(
|
||||||
|
boost::unknown_exception & )
|
||||||
|
{
|
||||||
|
//Boo! builtin exception was transported as a boost::unknown_exception
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
catch(
|
||||||
|
... )
|
||||||
|
{
|
||||||
|
BOOST_TEST(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user