Compare commits

..

17 Commits

Author SHA1 Message Date
8c7b14f68b Update categories in libraries.json 2021-11-07 20:33:59 +02:00
37ad7254d2 Enable syntax hightlighting 2021-10-28 23:18:32 +03:00
f6055628e6 Add msvc-14.3 to ci.yml 2021-10-28 23:18:06 +03:00
65eddbb2f0 Small fix for those using -Wsign-conversion (#21)
* Small fix for those using -Wsign-conversion

* Change I to std::size_t in wrapexcept_add_base

A better fix for -Wsign-conversion
2021-10-11 21:07:06 +03:00
121c1407fd Merge branch 'develop' into feature/bx-rethrow-nx 2021-09-30 22:19:18 +03:00
5eff93e41b Update ci.yml 2021-09-30 22:00:09 +03:00
8787d13e65 Update ci.yml 2021-09-30 21:36:58 +03:00
0a922307ec Update ci.yml 2021-09-30 21:34:37 +03:00
9ca27bddfc Make clone_impl::rethrow use boost::throw_exception when exceptions are disabled 2021-09-30 21:24:13 +03:00
1d555aff4b Fix throw_exception_nx_test2 2021-09-30 21:16:03 +03:00
b432f24664 Update make_exception_ptr_nx tests to use boost::make_exception_ptr 2021-09-30 20:49:40 +03:00
9f6a2e7b89 Disable warning 4530 2021-09-30 20:46:02 +03:00
95e02ea52b Update .github/workflows 2021-04-19 21:30:04 +03:00
834a4f04dc Update .github/workflows 2021-04-19 20:32:32 +03:00
ad30f163ef Add -DBUILD_TESTING=ON to .yml files; it's not default anymore 2021-03-19 04:21:23 +02:00
b1f6a8b25f Fix .travis.yml 2021-03-18 16:22:56 +02:00
264ee74b64 Update .travis.yml 2021-03-18 02:34:31 +02:00
11 changed files with 106 additions and 94 deletions

View File

@ -17,24 +17,17 @@ jobs:
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
os: ubuntu-18.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
os: ubuntu-18.04
install: g++-5
- toolset: gcc-6
cxxstd: "03,11,14,1z"
os: ubuntu-16.04
os: ubuntu-18.04
install: g++-6
- toolset: gcc-7
cxxstd: "03,11,14,17"
@ -42,51 +35,38 @@ jobs:
- toolset: gcc-8
cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04
install: g++-8
- toolset: gcc-9
cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04
os: ubuntu-20.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
os: ubuntu-20.04
install: g++-10
- toolset: gcc-11
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
install: g++-11
- toolset: clang
compiler: clang++-3.9
cxxstd: "03,11,14"
os: ubuntu-16.04
os: ubuntu-18.04
install: clang-3.9
- toolset: clang
compiler: clang++-4.0
cxxstd: "03,11,14"
os: ubuntu-16.04
os: ubuntu-18.04
install: clang-4.0
- toolset: clang
compiler: clang++-5.0
cxxstd: "03,11,14,1z"
os: ubuntu-16.04
os: ubuntu-18.04
install: clang-5.0
- toolset: clang
compiler: clang++-6.0
cxxstd: "03,11,14,17"
os: ubuntu-18.04
install: clang-6.0
- toolset: clang
compiler: clang++-7
cxxstd: "03,11,14,17"
@ -94,16 +74,29 @@ jobs:
install: clang-7
- toolset: clang
compiler: clang++-8
cxxstd: "03,11,14,17,2a"
cxxstd: "03,11,14,17"
os: ubuntu-20.04
install: clang-8
- toolset: clang
compiler: clang++-9
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
install: clang-9
- toolset: clang
compiler: clang++-10
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
install: clang-10
- toolset: clang
compiler: clang++-11
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
install: clang-11
- toolset: clang
compiler: clang++-12
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
install: clang-12
- toolset: clang
cxxstd: "03,11,14,17,2a"
os: macos-10.15
@ -162,6 +155,10 @@ jobs:
cxxstd: "14,17,latest"
addrmd: 32,64
os: windows-2019
- toolset: msvc-14.3
cxxstd: "14,17,latest"
addrmd: 32,64
os: windows-2022
- toolset: gcc
cxxstd: "03,11,14,17,2a"
addrmd: 64

View File

@ -22,10 +22,6 @@ matrix:
- env: BOGUS_JOB=true
include:
- os: linux
compiler: g++
env: TOOLSET=gcc COMPILER=g++ CXXSTD=03,11
- os: linux
compiler: g++-4.4
env: TOOLSET=gcc COMPILER=g++-4.4 CXXSTD=98,0x
@ -127,19 +123,16 @@ matrix:
- ubuntu-toolchain-r-test
- os: linux
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
dist: bionic
compiler: g++-10
env: UBSAN=1 TOOLSET=gcc COMPILER=g++-10 CXXSTD=03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1 LINKFLAGS=-fuse-ld=gold
addons:
apt:
packages:
- g++-9
- g++-10
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11
- os: linux
dist: trusty
compiler: /usr/bin/clang++
@ -220,6 +213,7 @@ matrix:
- ubuntu-toolchain-r-test
- os: linux
dist: bionic
compiler: clang++-5.0
env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z
addons:
@ -230,6 +224,7 @@ matrix:
- ubuntu-toolchain-r-test
- os: linux
dist: bionic
compiler: clang++-6.0
env: TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=03,11,14,17
addons:
@ -240,6 +235,7 @@ matrix:
- ubuntu-toolchain-r-test
- os: linux
dist: bionic
compiler: clang++-7
env: TOOLSET=clang COMPILER=clang++-7 CXXSTD=03,11,14,17,2a
addons:
@ -248,9 +244,10 @@ matrix:
- clang-7
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-7
- llvm-toolchain-bionic-7
- os: linux
dist: bionic
compiler: clang++-8
env: TOOLSET=clang COMPILER=clang++-8 CXXSTD=03,11,14,17,2a
addons:
@ -259,9 +256,10 @@ matrix:
- clang-8
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-8
- llvm-toolchain-bionic-8
- os: linux
dist: bionic
compiler: clang++-9
env: TOOLSET=clang COMPILER=clang++-9 CXXSTD=03,11,14,17,2a
addons:
@ -270,28 +268,47 @@ matrix:
- clang-9
sources:
- ubuntu-toolchain-r-test
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
- sourceline: 'deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-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=03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1
dist: bionic
compiler: clang++-10
env: TOOLSET=clang COMPILER=clang++-10 CXXSTD=03,11,14,17,2a
addons:
apt:
packages:
- clang-8
- clang-10
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-8
- sourceline: 'deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- os: linux
dist: trusty
compiler: clang++-libc++
env: TOOLSET=clang COMPILER=clang++-libc++ CXXSTD=03,11,14,1z
dist: bionic
compiler: clang++-11
env: TOOLSET=clang COMPILER=clang++-11 CXXSTD=03,11,14,17,2a
addons:
apt:
packages:
- libc++-dev
- clang-11
sources:
- ubuntu-toolchain-r-test
- sourceline: 'deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- os: linux
dist: bionic
compiler: clang++-12
env: UBSAN=1 TOOLSET=clang COMPILER=clang++-12 CXXSTD=03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1
addons:
apt:
packages:
- clang-12
sources:
- ubuntu-toolchain-r-test
- sourceline: 'deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-12 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- os: linux
dist: trusty
@ -302,9 +319,14 @@ matrix:
packages:
- libc++-dev
- os: osx
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
- os: linux
dist: bionic
compiler: clang++-libc++
env: TOOLSET=clang COMPILER=clang++-libc++ CXXSTD=03,11,14,17,2a
addons:
apt:
packages:
- libc++-dev
- os: osx
compiler: clang++
@ -314,7 +336,7 @@ matrix:
env: CMAKE=1
script:
- mkdir __build__ && cd __build__
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=throw_exception ..
- cmake -DBOOST_ENABLE_CMAKE=1 -DBUILD_TESTING=ON -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=throw_exception ..
- ctest --output-on-failure -R boost_throw_exception
- os: linux

View File

@ -9,6 +9,8 @@ Peter Dimov, Emil Dotchevski
:toc: left
:idprefix:
:docinfo: private-footer
:source-highlighter: rouge
:source-language: c++
:leveloffset: +1

View File

@ -7,6 +7,7 @@
#define BOOST_EXCEPTION_274DA366004E11DCB1DDFE2E56D89593
#include <boost/config.hpp>
#include <exception>
#ifdef BOOST_EXCEPTION_MINI_BOOST
#include <memory>
@ -390,6 +391,9 @@ boost
}
////////////////////////////////////////////////////////////////////////
#if defined(BOOST_NO_EXCEPTIONS)
BOOST_NORETURN void throw_exception(std::exception const & e); // user defined
#endif
namespace
exception_detail
@ -466,7 +470,11 @@ boost
void
rethrow() const
{
#if defined(BOOST_NO_EXCEPTIONS)
boost::throw_exception(*this);
#else
throw*this;
#endif
}
};
}

View File

@ -25,6 +25,7 @@
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#include <exception>
#include <cstddef>
#if !defined( BOOST_EXCEPTION_DISABLE ) && defined( BOOST_BORLANDC ) && BOOST_WORKAROUND( BOOST_BORLANDC, BOOST_TESTED_AT(0x593) )
# define BOOST_EXCEPTION_DISABLE
@ -51,7 +52,7 @@ typedef char (&wrapexcept_s2)[ 2 ];
template<class T> wrapexcept_s1 wrapexcept_is_convertible( T* );
template<class T> wrapexcept_s2 wrapexcept_is_convertible( void* );
template<class E, class B, int I = sizeof( wrapexcept_is_convertible<B>( static_cast< E* >( 0 ) ) ) > struct wrapexcept_add_base;
template<class E, class B, std::size_t I = sizeof( wrapexcept_is_convertible<B>( static_cast< E* >( 0 ) ) ) > struct wrapexcept_add_base;
template<class E, class B> struct wrapexcept_add_base<E, B, 1>
{

View File

@ -11,7 +11,8 @@
],
"description": "A common infrastructure for throwing exceptions from Boost libraries.",
"category": [
"Miscellaneous"
"Emulation",
"Error-handling"
],
"cxxstd": "03"
}

View File

@ -5,27 +5,16 @@
#if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
# pragma warning(disable: 4577) // noexcept used without /EHsc
# pragma warning(disable: 4530) // C++ exception handler used
#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 );
}
#include <boost/exception_ptr.hpp>
class my_exception: public std::exception {};
int main()
{
::make_exception_ptr( my_exception() );
boost::make_exception_ptr( my_exception() );
}
namespace boost

View File

@ -5,29 +5,18 @@
#if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
# pragma warning(disable: 4577) // noexcept used without /EHsc
# pragma warning(disable: 4530) // C++ exception handler used
#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 );
}
#include <boost/exception_ptr.hpp>
class my_exception: public std::exception {};
int main()
{
::make_exception_ptr( my_exception() );
boost::make_exception_ptr( my_exception() );
}
namespace boost

View File

@ -5,6 +5,7 @@
#if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
# pragma warning(disable: 4577) // noexcept used without /EHsc
# pragma warning(disable: 4530) // C++ exception handler used
#endif
#include <boost/throw_exception.hpp>

View File

@ -5,6 +5,7 @@
#if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
# pragma warning(disable: 4577) // noexcept used without /EHsc
# pragma warning(disable: 4530) // C++ exception handler used
#endif
#include <boost/throw_exception.hpp>
@ -27,7 +28,7 @@ void throw_exception( std::exception const &, boost::source_location const & loc
int r = 0;
if( std::strcmp( loc.file_name(), __FILE__ ) != 0 ) ++r;
if( loc.line() != 18 ) ++r;
if( loc.line() != 19 ) ++r;
std::exit( r );
}

View File

@ -5,6 +5,7 @@
#if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
# pragma warning(disable: 4577) // noexcept used without /EHsc
# pragma warning(disable: 4530) // C++ exception handler used
#endif
// Make sure that simple inclusion does not