mirror of
https://github.com/boostorg/multiprecision.git
synced 2026-01-19 04:22:11 +00:00
Merge branch 'develop' of https://github.com/boostorg/multiprecision into double_fp_backend_alternate_algos
This commit is contained in:
@@ -15,16 +15,16 @@ echo '==================================> BEFORE_INSTALL'
|
||||
echo '==================================> INSTALL'
|
||||
|
||||
cd ..
|
||||
git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
for i in 1 2 3 4 5; do git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root && break || sleep 15; done
|
||||
cd boost-root
|
||||
git submodule update --init tools/build
|
||||
git submodule update --init libs/config
|
||||
git submodule update --init libs/polygon
|
||||
git submodule update --init tools/boost_install
|
||||
git submodule update --init libs/headers
|
||||
git submodule update --init tools/boostdep
|
||||
for i in 1 2 3 4 5; do git submodule update --init tools/build && break || sleep 15; done
|
||||
for i in 1 2 3 4 5; do git submodule update --init libs/config && break || sleep 15; done
|
||||
for i in 1 2 3 4 5; do git submodule update --init libs/polygon && break || sleep 15; done
|
||||
for i in 1 2 3 4 5; do git submodule update --init tools/boost_install && break || sleep 15; done
|
||||
for i in 1 2 3 4 5; do git submodule update --init libs/headers && break || sleep 15; done
|
||||
for i in 1 2 3 4 5; do git submodule update --init tools/boostdep && break || sleep 15; done
|
||||
cp -r $TRAVIS_BUILD_DIR/* libs/multiprecision
|
||||
python tools/boostdep/depinst/depinst.py multiprecision
|
||||
for i in 1 2 3 4 5; do python tools/boostdep/depinst/depinst.py multiprecision && break || sleep 15; done
|
||||
./bootstrap.sh
|
||||
./b2 headers
|
||||
|
||||
@@ -35,7 +35,7 @@ echo '==================================> BEFORE_SCRIPT'
|
||||
echo '==================================> SCRIPT'
|
||||
|
||||
echo "using $TOOLSET : : $COMPILER : <cxxflags>-std=$CXXSTD ;" > ~/user-config.jam
|
||||
(cd libs/config/test && ../../../b2 config_info_travis_install toolset=$TOOLSET && ./config_info_travis)
|
||||
(cd libs/config/test && ../../../b2 print_config_info print_math_info toolset=$TOOLSET)
|
||||
(cd libs/multiprecision/test && ../../../b2 -j3 toolset=$TOOLSET $TEST_SUITE define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER)
|
||||
|
||||
echo '==================================> AFTER_SUCCESS'
|
||||
|
||||
17
.drone.star
17
.drone.star
@@ -184,6 +184,23 @@ def main(ctx):
|
||||
osx_cxx("XCode 8.3, c++14 misc", "clang++", packages="", buildtype="boost", xcode_version="8.3", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': 'c++14', 'TEST_SUITE': 'misc', }, globalenv=globalenv),
|
||||
osx_cxx("XCode 8.3, c++14 compile_fail examples", "clang++", packages="", buildtype="boost", xcode_version="8.3", environment={'TEST_SUITE': 'compile_fail examples', 'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': 'c++14', }, globalenv=globalenv),
|
||||
osx_cxx("XCode 8.3, c++14 concepts", "clang++", packages="", buildtype="boost", xcode_version="8.3", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': 'c++14', 'TEST_SUITE': 'concepts', }, globalenv=globalenv),
|
||||
|
||||
linux_cxx("Ubuntu ARM64 g++ std=gnu++17 arithmetic_tests", "g++", packages="libgmp-dev libmpfr-dev libmpc-dev libmpfi-dev libtommath-dev", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="arm64", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': 'gnu++17', 'TEST_SUITE': 'arithmetic_tests', }, globalenv=globalenv),
|
||||
linux_cxx("Ubuntu ARM64 g++ std=gnu++17 cpp_int_tests", "g++", packages="libgmp-dev libmpfr-dev libmpc-dev libmpfi-dev libtommath-dev", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="arm64", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': 'gnu++17', 'TEST_SUITE': 'cpp_int_tests', }, globalenv=globalenv),
|
||||
linux_cxx("Ubuntu ARM64 g++ std=gnu++17 functions_and_limits", "g++", packages="libgmp-dev libmpfr-dev libmpc-dev libmpfi-dev libtommath-dev", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="arm64", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': 'gnu++17', 'TEST_SUITE': 'functions_and_limits', }, globalenv=globalenv),
|
||||
linux_cxx("Ubuntu ARM64 g++ std=gnu++17 conversions performance", "g++", packages="libgmp-dev libmpfr-dev libmpc-dev libmpfi-dev libtommath-dev", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="arm64", environment={'TEST_SUITE': 'conversions performance', 'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': 'gnu++17', }, globalenv=globalenv),
|
||||
linux_cxx("Ubuntu ARM64 g++ std=gnu++17 misc", "g++", packages="libgmp-dev libmpfr-dev libmpc-dev libmpfi-dev libtommath-dev", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="arm64", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': 'gnu++17', 'TEST_SUITE': 'misc', }, globalenv=globalenv),
|
||||
linux_cxx("Ubuntu ARM64 g++ std=gnu++17 compile_fail examples", "g++", packages="libgmp-dev libmpfr-dev libmpc-dev libmpfi-dev libtommath-dev", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="arm64", environment={'TEST_SUITE': 'compile_fail examples', 'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': 'gnu++17', }, globalenv=globalenv),
|
||||
linux_cxx("Ubuntu ARM64 g++ std=gnu++17 concepts", "g++", packages="libgmp-dev libmpfr-dev libmpc-dev libmpfi-dev libtommath-dev", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="arm64", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': 'gnu++17', 'TEST_SUITE': 'concepts', }, globalenv=globalenv),
|
||||
|
||||
linux_cxx("Ubuntu s390x g++ std=gnu++17 arithmetic_tests", "g++", packages="libgmp-dev libmpfr-dev libmpc-dev libmpfi-dev libtommath-dev", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="s390x", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': 'gnu++17', 'TEST_SUITE': 'arithmetic_tests', }, globalenv=globalenv),
|
||||
linux_cxx("Ubuntu s390x g++ std=gnu++17 cpp_int_tests", "g++", packages="libgmp-dev libmpfr-dev libmpc-dev libmpfi-dev libtommath-dev", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="s390x", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': 'gnu++17', 'TEST_SUITE': 'cpp_int_tests', }, globalenv=globalenv),
|
||||
linux_cxx("Ubuntu s390x g++ std=gnu++17 functions_and_limits", "g++", packages="libgmp-dev libmpfr-dev libmpc-dev libmpfi-dev libtommath-dev", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="s390x", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': 'gnu++17', 'TEST_SUITE': 'functions_and_limits', }, globalenv=globalenv),
|
||||
linux_cxx("Ubuntu s390x g++ std=gnu++17 conversions performance", "g++", packages="libgmp-dev libmpfr-dev libmpc-dev libmpfi-dev libtommath-dev", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="s390x", environment={'TEST_SUITE': 'conversions performance', 'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': 'gnu++17', }, globalenv=globalenv),
|
||||
linux_cxx("Ubuntu s390x g++ std=gnu++17 misc", "g++", packages="libgmp-dev libmpfr-dev libmpc-dev libmpfi-dev libtommath-dev", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="s390x", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': 'gnu++17', 'TEST_SUITE': 'misc', }, globalenv=globalenv),
|
||||
linux_cxx("Ubuntu s390x g++ std=gnu++17 compile_fail examples", "g++", packages="libgmp-dev libmpfr-dev libmpc-dev libmpfi-dev libtommath-dev", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="s390x", environment={'TEST_SUITE': 'compile_fail examples', 'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': 'gnu++17', }, globalenv=globalenv),
|
||||
linux_cxx("Ubuntu s390x g++ std=gnu++17 concepts", "g++", packages="libgmp-dev libmpfr-dev libmpc-dev libmpfi-dev libtommath-dev", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="s390x", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': 'gnu++17', 'TEST_SUITE': 'concepts', }, globalenv=globalenv),
|
||||
|
||||
]
|
||||
|
||||
# from https://github.com/boostorg/boost-ci
|
||||
|
||||
100
.github/workflows/multiprecision.yml
vendored
100
.github/workflows/multiprecision.yml
vendored
@@ -68,15 +68,15 @@ jobs:
|
||||
- name: Generate user config
|
||||
run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : <cxxflags>-std=${{ matrix.standard }} ;" > ~/user-config.jam'
|
||||
working-directory: ../boost-root
|
||||
- name: Config info install
|
||||
run: ../../../b2 config_info_travis_install toolset=$TOOLSET
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Config info
|
||||
run: ./config_info_travis
|
||||
- name: Config Info
|
||||
run: ../../../b2 print_config_info print_math_info toolset=$TOOLSET
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Test
|
||||
run: ../../../b2 -j2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES include=/usr/include/eigen3
|
||||
working-directory: ../boost-root/libs/multiprecision/test
|
||||
- name: b2 config
|
||||
run: cat bin.v2/config.log
|
||||
working-directory: ../boost-root/
|
||||
ubuntu-focal:
|
||||
runs-on: ubuntu-20.04
|
||||
defaults:
|
||||
@@ -130,15 +130,15 @@ jobs:
|
||||
- name: Generate user config
|
||||
run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : <cxxflags>-std=${{ matrix.standard }} ;" > ~/user-config.jam'
|
||||
working-directory: ../boost-root
|
||||
- name: Config info install
|
||||
run: ../../../b2 config_info_travis_install toolset=$TOOLSET
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Config info
|
||||
run: ./config_info_travis
|
||||
- name: Config Info
|
||||
run: ../../../b2 print_config_info print_math_info toolset=$TOOLSET
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Test
|
||||
run: ../../../b2 -j2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES include=/usr/include/eigen3
|
||||
working-directory: ../boost-root/libs/multiprecision/test
|
||||
- name: b2 config
|
||||
run: cat bin.v2/config.log
|
||||
working-directory: ../boost-root/
|
||||
ubuntu-focal-slow-tests:
|
||||
runs-on: ubuntu-20.04
|
||||
defaults:
|
||||
@@ -192,15 +192,15 @@ jobs:
|
||||
- name: Generate user config
|
||||
run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : <cxxflags>-std=${{ matrix.standard }} ;" > ~/user-config.jam'
|
||||
working-directory: ../boost-root
|
||||
- name: Config info install
|
||||
run: ../../../b2 config_info_travis_install toolset=$TOOLSET
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Config info
|
||||
run: ./config_info_travis
|
||||
- name: Config Info
|
||||
run: ../../../b2 print_config_info print_math_info toolset=$TOOLSET
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Test
|
||||
run: ../../../b2 -j2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES include=/usr/include/eigen3
|
||||
working-directory: ../boost-root/libs/multiprecision/test
|
||||
- name: b2 config
|
||||
run: cat bin.v2/config.log
|
||||
working-directory: ../boost-root/
|
||||
ubuntu-focal-standalone-tests:
|
||||
runs-on: ubuntu-20.04
|
||||
defaults:
|
||||
@@ -254,15 +254,15 @@ jobs:
|
||||
- name: Generate user config
|
||||
run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : <cxxflags>-std=${{ matrix.standard }} ;" > ~/user-config.jam'
|
||||
working-directory: ../boost-root
|
||||
- name: Config info install
|
||||
run: ../../../b2 config_info_travis_install toolset=$TOOLSET
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Config info
|
||||
run: ./config_info_travis
|
||||
- name: Config Info
|
||||
run: ../../../b2 print_config_info print_math_info toolset=$TOOLSET
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Test
|
||||
run: ../../../b2 -j2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES
|
||||
working-directory: ../boost-root/libs/multiprecision/test
|
||||
- name: b2 config
|
||||
run: cat bin.v2/config.log
|
||||
working-directory: ../boost-root/
|
||||
ubuntu-focal-ASAN:
|
||||
runs-on: ubuntu-20.04
|
||||
defaults:
|
||||
@@ -316,15 +316,15 @@ jobs:
|
||||
- name: Generate user config
|
||||
run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : <cxxflags>-std=${{ matrix.standard }} ;" > ~/user-config.jam'
|
||||
working-directory: ../boost-root
|
||||
- name: Config info install
|
||||
run: ../../../b2 config_info_travis_install toolset=$TOOLSET
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Config info
|
||||
run: ./config_info_travis
|
||||
- name: Config Info
|
||||
run: ../../../b2 print_config_info print_math_info toolset=$TOOLSET
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Test
|
||||
run: ../../../b2 define=BOOST_CI_ASAN_BUILD define=BOOST_CI_SANITIZER_BUILD cxxflags=-fsanitize=address linkflags=-fsanitize=address toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES
|
||||
working-directory: ../boost-root/libs/multiprecision/test
|
||||
- name: b2 config
|
||||
run: cat bin.v2/config.log
|
||||
working-directory: ../boost-root/
|
||||
ubuntu-focal-UBSAN:
|
||||
runs-on: ubuntu-20.04
|
||||
defaults:
|
||||
@@ -378,15 +378,15 @@ jobs:
|
||||
- name: Generate user config
|
||||
run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : <cxxflags>-std=${{ matrix.standard }} ;" > ~/user-config.jam'
|
||||
working-directory: ../boost-root
|
||||
- name: Config info install
|
||||
run: ../../../b2 config_info_travis_install toolset=$TOOLSET
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Config info
|
||||
run: ./config_info_travis
|
||||
- name: Config Info
|
||||
run: ../../../b2 print_config_info print_math_info toolset=$TOOLSET
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Test
|
||||
run: ../../../b2 define=BOOST_CI_UBSAN_BUILD define=BOOST_CI_SANITIZER_BUILD cxxflags=-fsanitize=undefined linkflags=-fsanitize=undefined toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES
|
||||
working-directory: ../boost-root/libs/multiprecision/test
|
||||
- name: b2 config
|
||||
run: cat bin.v2/config.log
|
||||
working-directory: ../boost-root/
|
||||
windows_gcc:
|
||||
runs-on: windows-2019
|
||||
defaults:
|
||||
@@ -421,15 +421,15 @@ jobs:
|
||||
- name: Generate headers
|
||||
run: b2 headers
|
||||
working-directory: ../boost-root
|
||||
- name: Config info install
|
||||
run: ..\..\..\b2 config_info_travis_install %ARGS%
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Config info
|
||||
run: config_info_travis
|
||||
- name: Config Info
|
||||
run: ..\..\..\b2 print_config_info print_math_info %ARGS%
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Test
|
||||
run: ..\..\..\b2 -j2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }}
|
||||
working-directory: ../boost-root/libs/multiprecision/test
|
||||
- name: b2 config
|
||||
run: cat bin.v2/config.log
|
||||
working-directory: ../boost-root/
|
||||
windows_msvc_14_0:
|
||||
runs-on: windows-2019
|
||||
defaults:
|
||||
@@ -464,15 +464,15 @@ jobs:
|
||||
- name: Generate headers
|
||||
run: b2 headers
|
||||
working-directory: ../boost-root
|
||||
- name: Config info install
|
||||
run: ..\..\..\b2 config_info_travis_install %ARGS%
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Config info
|
||||
run: config_info_travis
|
||||
- name: Config Info
|
||||
run: ..\..\..\b2 print_config_info print_math_info %ARGS%
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Test
|
||||
run: ..\..\..\b2 -j2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }}
|
||||
working-directory: ../boost-root/libs/multiprecision/test
|
||||
- name: b2 config
|
||||
run: cat bin.v2/config.log
|
||||
working-directory: ../boost-root/
|
||||
windows_msvc_14_2:
|
||||
runs-on: windows-2019
|
||||
defaults:
|
||||
@@ -507,15 +507,15 @@ jobs:
|
||||
- name: Generate headers
|
||||
run: b2 headers
|
||||
working-directory: ../boost-root
|
||||
- name: Config info install
|
||||
run: ..\..\..\b2 config_info_travis_install %ARGS%
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Config info
|
||||
run: config_info_travis
|
||||
- name: Config Info
|
||||
run: ..\..\..\b2 print_config_info print_math_info %ARGS%
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Test
|
||||
run: ..\..\..\b2 -j2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }}
|
||||
working-directory: ../boost-root/libs/multiprecision/test
|
||||
- name: b2 config
|
||||
run: cat bin.v2/config.log
|
||||
working-directory: ../boost-root/
|
||||
macos:
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
@@ -545,12 +545,12 @@ jobs:
|
||||
- name: Generate headers
|
||||
run: ./b2 headers
|
||||
working-directory: ../boost-root
|
||||
- name: Config info install
|
||||
run: ../../../b2 config_info_travis_install toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }}
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Config info
|
||||
run: ./config_info_travis
|
||||
- name: Config Info
|
||||
run: ../../../b2 print_config_info print_math_info toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }}
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Test
|
||||
run: ../../../b2 -j2 toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }} ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES
|
||||
working-directory: ../boost-root/libs/multiprecision/test
|
||||
- name: b2 config
|
||||
run: cat bin.v2/config.log
|
||||
working-directory: ../boost-root/
|
||||
|
||||
@@ -2298,6 +2298,25 @@ template <std::size_t MinBits, std::size_t MaxBits, cpp_integer_type SignType, c
|
||||
struct number_category<cpp_int_backend<MinBits, MaxBits, SignType, Checked, Allocator> > : public std::integral_constant<int, number_kind_integer>
|
||||
{};
|
||||
|
||||
#ifdef BOOST_HAS_INT128
|
||||
|
||||
namespace detail {
|
||||
|
||||
template <std::size_t MinBits, std::size_t MaxBits, cpp_integer_type SignType, cpp_int_check_type Checked, class Allocator>
|
||||
struct is_convertible_arithmetic<int128_type, backends::cpp_int_backend<MinBits, MaxBits, SignType, Checked, Allocator> >
|
||||
{
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
template <std::size_t MinBits, std::size_t MaxBits, cpp_integer_type SignType, cpp_int_check_type Checked, class Allocator>
|
||||
struct is_convertible_arithmetic<uint128_type, backends::cpp_int_backend<MinBits, MaxBits, SignType, Checked, Allocator> >
|
||||
{
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
// see https://github.com/boostorg/multiprecision/issues/413
|
||||
// and https://github.com/boostorg/multiprecision/issues/431
|
||||
|
||||
@@ -50,7 +50,10 @@ BOOST_CXX14_CONSTEXPR T test_constexpr_add_subtract(T a)
|
||||
a += do_test_constexpr_add_subtract(a, a);
|
||||
a += do_test_constexpr_add_subtract(a, static_cast<unsigned char>(2));
|
||||
a += do_test_constexpr_add_subtract(a, static_cast<signed char>(2));
|
||||
a += do_test_constexpr_add_subtract(a, static_cast<char>(2));
|
||||
if constexpr(std::numeric_limits<char>::is_signed)
|
||||
a += do_test_constexpr_add_subtract(a, static_cast<char>(2));
|
||||
else
|
||||
a += do_test_constexpr_add_subtract(a, static_cast<signed char>(2)); // we need a consistent result.
|
||||
a += do_test_constexpr_add_subtract(a, static_cast<short>(2));
|
||||
a += do_test_constexpr_add_subtract(a, static_cast<unsigned short>(2));
|
||||
a += do_test_constexpr_add_subtract(a, static_cast<int>(2));
|
||||
|
||||
@@ -28,6 +28,10 @@ int main()
|
||||
|
||||
constexpr long long llv = (long long)b;
|
||||
|
||||
#if defined(BOOST_HAS_INT128) && !defined(BOOST_NO_CXX17_IF_CONSTEXPR)
|
||||
static_assert(std::is_constructible<int_backend, boost::int128_type>::value);
|
||||
#endif
|
||||
|
||||
static_assert(b == -108);
|
||||
static_assert(d == 554);
|
||||
static_assert(llv == -108);
|
||||
|
||||
Reference in New Issue
Block a user