Suppress non-ISO type warnings in constexpr testing

This commit is contained in:
Matt Borland
2022-07-11 12:39:49 -07:00
parent ec0481ec7b
commit a7c9d05aa5
2 changed files with 28 additions and 28 deletions

View File

@@ -60,12 +60,12 @@ BOOST_CXX14_CONSTEXPR T test_constexpr_add_subtract(T a)
a += do_test_constexpr_add_subtract(a, static_cast<long long>(2));
a += do_test_constexpr_add_subtract(a, static_cast<unsigned long long>(2));
#if defined(BOOST_HAS_INT128) && !defined(BOOST_NO_CXX17_IF_CONSTEXPR)
if constexpr (std::is_constructible<T, __int128>::value)
if constexpr (std::is_constructible<T, boost::int128_type>::value)
{
a += do_test_constexpr_add_subtract(a, static_cast<__int128>(2));
a += do_test_constexpr_add_subtract(a, static_cast<unsigned __int128>(2));
a -= do_test_constexpr_add_subtract(a, static_cast<__int128>(2));
a -= do_test_constexpr_add_subtract(a, static_cast<unsigned __int128>(2));
a += do_test_constexpr_add_subtract(a, static_cast<boost::int128_type>(2));
a += do_test_constexpr_add_subtract(a, static_cast<boost::uint128_type>(2));
a -= do_test_constexpr_add_subtract(a, static_cast<boost::int128_type>(2));
a -= do_test_constexpr_add_subtract(a, static_cast<boost::uint128_type>(2));
}
#endif
@@ -124,12 +124,12 @@ BOOST_CXX14_CONSTEXPR T test_constexpr_mul_divide(T a)
a += do_test_constexpr_mul_divide(a, static_cast<long long>(2));
a += do_test_constexpr_mul_divide(a, static_cast<unsigned long long>(2));
#if defined(BOOST_HAS_INT128) && !defined(BOOST_NO_CXX17_IF_CONSTEXPR)
if constexpr (std::is_constructible<T, __int128>::value)
if constexpr (std::is_constructible<T, boost::int128_type>::value)
{
a += do_test_constexpr_mul_divide(a, static_cast<__int128>(2));
a += do_test_constexpr_mul_divide(a, static_cast<unsigned __int128>(2));
a -= do_test_constexpr_mul_divide(a, static_cast<__int128>(2));
a -= do_test_constexpr_mul_divide(a, static_cast<unsigned __int128>(2));
a += do_test_constexpr_mul_divide(a, static_cast<boost::int128_type>(2));
a += do_test_constexpr_mul_divide(a, static_cast<boost::uint128_type>(2));
a -= do_test_constexpr_mul_divide(a, static_cast<boost::int128_type>(2));
a -= do_test_constexpr_mul_divide(a, static_cast<boost::uint128_type>(2));
}
#endif
@@ -169,7 +169,7 @@ BOOST_CXX14_CONSTEXPR T do_test_constexpr_bitwise(T a, U b)
a = a >> 2;
return a;
}
}
template <class T>
BOOST_CXX14_CONSTEXPR T test_constexpr_bitwise(T a)
@@ -187,10 +187,10 @@ BOOST_CXX14_CONSTEXPR T test_constexpr_bitwise(T a)
a += do_test_constexpr_bitwise(a, static_cast<long long>(2));
a += do_test_constexpr_bitwise(a, static_cast<unsigned long long>(2));
#if defined(BOOST_HAS_INT128) && !defined(BOOST_NO_CXX17_IF_CONSTEXPR)
if constexpr (std::is_constructible<T, __int128>::value)
if constexpr (std::is_constructible<T, boost::int128_type>::value)
{
a += do_test_constexpr_bitwise(a, static_cast<__int128>(2));
a += do_test_constexpr_bitwise(a, static_cast<unsigned __int128>(2));
a += do_test_constexpr_bitwise(a, static_cast<boost::int128_type>(2));
a += do_test_constexpr_bitwise(a, static_cast<boost::uint128_type>(2));
}
#endif
@@ -214,7 +214,7 @@ BOOST_CXX14_CONSTEXPR T do_test_constexpr_logical(T a, U b)
if(!a)
++result;
return result;
}
}
template <class T>
BOOST_CXX14_CONSTEXPR T test_constexpr_logical(T a)
@@ -232,12 +232,12 @@ BOOST_CXX14_CONSTEXPR T test_constexpr_logical(T a)
a += do_test_constexpr_logical(a, static_cast<long long>(2));
a += do_test_constexpr_logical(a, static_cast<unsigned long long>(2));
#if defined(BOOST_HAS_INT128) && !defined(BOOST_NO_CXX17_IF_CONSTEXPR)
if constexpr (std::is_constructible<T, __int128>::value)
if constexpr (std::is_constructible<T, boost::int128_type>::value)
{
a += do_test_constexpr_logical(a, static_cast<__int128>(2));
a += do_test_constexpr_logical(a, static_cast<unsigned __int128>(2));
a -= do_test_constexpr_logical(a, static_cast<__int128>(2));
a -= do_test_constexpr_logical(a, static_cast<unsigned __int128>(2));
a += do_test_constexpr_logical(a, static_cast<boost::int128_type>(2));
a += do_test_constexpr_logical(a, static_cast<boost::uint128_type>(2));
a -= do_test_constexpr_logical(a, static_cast<boost::int128_type>(2));
a -= do_test_constexpr_logical(a, static_cast<boost::uint128_type>(2));
}
#endif
@@ -278,7 +278,7 @@ BOOST_CXX14_CONSTEXPR T do_test_constexpr_compare(T a, U b)
++result;
return result;
}
}
template <class T>
BOOST_CXX14_CONSTEXPR T test_constexpr_compare(T a)
@@ -296,12 +296,12 @@ BOOST_CXX14_CONSTEXPR T test_constexpr_compare(T a)
a += do_test_constexpr_compare(a, static_cast<long long>(2));
a += do_test_constexpr_compare(a, static_cast<unsigned long long>(2));
#if defined(BOOST_HAS_INT128) && !defined(BOOST_NO_CXX17_IF_CONSTEXPR)
if constexpr (std::is_constructible<T, __int128>::value)
if constexpr (std::is_constructible<T, boost::int128_type>::value)
{
a += do_test_constexpr_compare(a, static_cast<__int128>(2));
a += do_test_constexpr_compare(a, static_cast<unsigned __int128>(2));
a -= do_test_constexpr_compare(a, static_cast<__int128>(2));
a -= do_test_constexpr_compare(a, static_cast<unsigned __int128>(2));
a += do_test_constexpr_compare(a, static_cast<boost::int128_type>(2));
a += do_test_constexpr_compare(a, static_cast<boost::uint128_type>(2));
a -= do_test_constexpr_compare(a, static_cast<boost::int128_type>(2));
a -= do_test_constexpr_compare(a, static_cast<boost::uint128_type>(2));
}
#endif

View File

@@ -10,7 +10,7 @@ template <class T>
constexpr int expected_1()
{
#ifdef BOOST_HAS_INT128
if constexpr (std::is_constructible<T, __int128>::value)
if constexpr (std::is_constructible<T, boost::int128_type>::value)
return 230;
else
#endif
@@ -20,7 +20,7 @@ template <class T>
constexpr int expected_2()
{
#ifdef BOOST_HAS_INT128
if constexpr (std::is_constructible<T, __int128>::value)
if constexpr (std::is_constructible<T, boost::int128_type>::value)
return 120;
else
#endif