// (C) Copyright John Maddock 2017. // 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) #include #if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) // // These tests don't pass with GCC-4.x: // #if !defined(BOOST_GCC) || (BOOST_GCC >= 50000) void test_noexcept(unsigned char a, unsigned char b) { static_assert(noexcept(boost::integer::gcd(static_cast(a), static_cast(b))), "Expected a noexcept function."); #ifndef _MSC_VER // This generates an internal compiler error if enabled as well as the following test: static_assert(noexcept(boost::integer::gcd(static_cast(a), static_cast(b))), "Expected a noexcept function."); #endif static_assert(noexcept(boost::integer::gcd(static_cast(a), static_cast(b))), "Expected a noexcept function."); static_assert(noexcept(boost::integer::gcd(static_cast(a), static_cast(b))), "Expected a noexcept function."); static_assert(noexcept(boost::integer::gcd(static_cast(a), static_cast(b))), "Expected a noexcept function."); static_assert(noexcept(boost::integer::gcd(static_cast(a), static_cast(b))), "Expected a noexcept function."); static_assert(noexcept(boost::integer::gcd(static_cast(a), static_cast(b))), "Expected a noexcept function."); static_assert(noexcept(boost::integer::gcd(static_cast(a), static_cast(b))), "Expected a noexcept function."); static_assert(noexcept(boost::integer::gcd(static_cast(a), static_cast(b))), "Expected a noexcept function."); static_assert(noexcept(boost::integer::gcd(static_cast(a), static_cast(b))), "Expected a noexcept function."); static_assert(noexcept(boost::integer::gcd(static_cast(a), static_cast(b))), "Expected a noexcept function."); } #endif #endif