diff --git a/include/boost/decimal/decimal128_t.hpp b/include/boost/decimal/decimal128_t.hpp index 81aa6e4b2..5568a71a0 100644 --- a/include/boost/decimal/decimal128_t.hpp +++ b/include/boost/decimal/decimal128_t.hpp @@ -2228,22 +2228,12 @@ constexpr auto scalbnd128(decimal128_t num, const int expval) noexcept -> decima return scalblnd128(num, static_cast(expval)); } -} //namespace decimal -} //namespace boost - -namespace std { +namespace detail { -template<> -#ifdef _MSC_VER -class numeric_limits -#else -struct numeric_limits -#endif +template +class numeric_limits_impl128 { - -#ifdef _MSC_VER - public: -#endif +public: static constexpr bool is_specialized = true; static constexpr bool is_signed = true; @@ -2271,7 +2261,7 @@ struct numeric_limits static constexpr int min_exponent10 = min_exponent; static constexpr int max_exponent = 6144; static constexpr int max_exponent10 = max_exponent; - static constexpr bool traps = numeric_limits::traps; + static constexpr bool traps = std::numeric_limits::traps; static constexpr bool tinyness_before = true; // Member functions @@ -2286,6 +2276,59 @@ struct numeric_limits static constexpr auto denorm_min () -> boost::decimal::decimal128_t { return {1, boost::decimal::detail::etiny_v}; } }; +#if !defined(__cpp_inline_variables) || __cpp_inline_variables < 201606L + +template constexpr bool numeric_limits_impl128::is_specialized; +template constexpr bool numeric_limits_impl128::is_signed; +template constexpr bool numeric_limits_impl128::is_integer; +template constexpr bool numeric_limits_impl128::is_exact; +template constexpr bool numeric_limits_impl128::has_infinity; +template constexpr bool numeric_limits_impl128::has_quiet_NaN; +template constexpr bool numeric_limits_impl128::has_signaling_NaN; + +// These members were deprecated in C++23 +#if ((!defined(_MSC_VER) && (__cplusplus <= 202002L)) || (defined(_MSC_VER) && (_MSVC_LANG <= 202002L))) +template constexpr std::float_denorm_style numeric_limits_impl128::has_denorm; +template constexpr bool numeric_limits_impl128::has_denorm_loss; +#endif + +template constexpr std::float_round_style numeric_limits_impl128::round_style; +template constexpr bool numeric_limits_impl128::is_iec559; +template constexpr bool numeric_limits_impl128::is_bounded; +template constexpr bool numeric_limits_impl128::is_modulo; +template constexpr int numeric_limits_impl128::digits; +template constexpr int numeric_limits_impl128::digits10; +template constexpr int numeric_limits_impl128::max_digits10; +template constexpr int numeric_limits_impl128::radix; +template constexpr int numeric_limits_impl128::min_exponent; +template constexpr int numeric_limits_impl128::min_exponent10; +template constexpr int numeric_limits_impl128::max_exponent; +template constexpr int numeric_limits_impl128::max_exponent10; +template constexpr bool numeric_limits_impl128::traps; +template constexpr bool numeric_limits_impl128::tinyness_before; + +#endif // !defined(__cpp_inline_variables) || __cpp_inline_variables < 201606L + +} // namespace detail + +} //namespace decimal +} //namespace boost + +namespace std { + +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmismatched-tags" +#endif + +template <> +class numeric_limits : + public boost::decimal::detail::numeric_limits_impl128 {}; + +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + } //namespace std #include diff --git a/include/boost/decimal/decimal32_t.hpp b/include/boost/decimal/decimal32_t.hpp index 9455b0e81..4ad62bf46 100644 --- a/include/boost/decimal/decimal32_t.hpp +++ b/include/boost/decimal/decimal32_t.hpp @@ -2297,22 +2297,12 @@ constexpr auto copysignd32(decimal32_t mag, const decimal32_t sgn) noexcept -> d return mag; } -} // namespace decimal -} // namespace boost - -namespace std { +namespace detail { -template <> -#ifdef _MSC_VER -class numeric_limits -#else -struct numeric_limits -#endif +template +class numeric_limits_impl32 { - -#ifdef _MSC_VER public: -#endif static constexpr bool is_specialized = true; static constexpr bool is_signed = true; @@ -2340,7 +2330,7 @@ struct numeric_limits static constexpr int min_exponent10 = min_exponent; static constexpr int max_exponent = 96; static constexpr int max_exponent10 = max_exponent; - static constexpr bool traps = numeric_limits::traps; + static constexpr bool traps = std::numeric_limits::traps; static constexpr bool tinyness_before = true; // Member functions @@ -2353,8 +2343,62 @@ struct numeric_limits static constexpr auto quiet_NaN () -> boost::decimal::decimal32_t { return boost::decimal::from_bits(boost::decimal::detail::d32_nan_mask); } static constexpr auto signaling_NaN() -> boost::decimal::decimal32_t { return boost::decimal::from_bits(boost::decimal::detail::d32_snan_mask); } static constexpr auto denorm_min () -> boost::decimal::decimal32_t { return {1, boost::decimal::detail::etiny}; } + }; +#if !defined(__cpp_inline_variables) || __cpp_inline_variables < 201606L + +template constexpr bool numeric_limits_impl32::is_specialized; +template constexpr bool numeric_limits_impl32::is_signed; +template constexpr bool numeric_limits_impl32::is_integer; +template constexpr bool numeric_limits_impl32::is_exact; +template constexpr bool numeric_limits_impl32::has_infinity; +template constexpr bool numeric_limits_impl32::has_quiet_NaN; +template constexpr bool numeric_limits_impl32::has_signaling_NaN; + +// These members were deprecated in C++23 +#if ((!defined(_MSC_VER) && (__cplusplus <= 202002L)) || (defined(_MSC_VER) && (_MSVC_LANG <= 202002L))) +template constexpr std::float_denorm_style numeric_limits_impl32::has_denorm; +template constexpr bool numeric_limits_impl32::has_denorm_loss; +#endif + +template constexpr std::float_round_style numeric_limits_impl32::round_style; +template constexpr bool numeric_limits_impl32::is_iec559; +template constexpr bool numeric_limits_impl32::is_bounded; +template constexpr bool numeric_limits_impl32::is_modulo; +template constexpr int numeric_limits_impl32::digits; +template constexpr int numeric_limits_impl32::digits10; +template constexpr int numeric_limits_impl32::max_digits10; +template constexpr int numeric_limits_impl32::radix; +template constexpr int numeric_limits_impl32::min_exponent; +template constexpr int numeric_limits_impl32::min_exponent10; +template constexpr int numeric_limits_impl32::max_exponent; +template constexpr int numeric_limits_impl32::max_exponent10; +template constexpr bool numeric_limits_impl32::traps; +template constexpr bool numeric_limits_impl32::tinyness_before; + +#endif // !defined(__cpp_inline_variables) || __cpp_inline_variables < 201606L + +} // namespace detail + +} // namespace decimal +} // namespace boost + +namespace std { + +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmismatched-tags" +#endif + +template <> +class numeric_limits : + public boost::decimal::detail::numeric_limits_impl32 {}; + +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + } // Namespace std #include diff --git a/include/boost/decimal/decimal64_t.hpp b/include/boost/decimal/decimal64_t.hpp index d287234e5..f456cfa07 100644 --- a/include/boost/decimal/decimal64_t.hpp +++ b/include/boost/decimal/decimal64_t.hpp @@ -2192,22 +2192,12 @@ constexpr auto copysignd64(decimal64_t mag, const decimal64_t sgn) noexcept -> d return mag; } -} //namespace decimal -} //namespace boost - -namespace std { +namespace detail { -template <> -#ifdef _MSC_VER -class numeric_limits -#else -struct numeric_limits -#endif +template +class numeric_limits_impl64 { - -#ifdef _MSC_VER - public: -#endif +public: static constexpr bool is_specialized = true; static constexpr bool is_signed = true; @@ -2235,7 +2225,7 @@ struct numeric_limits static constexpr int min_exponent10 = min_exponent; static constexpr int max_exponent = 384; static constexpr int max_exponent10 = max_exponent; - static constexpr bool traps = numeric_limits::traps; + static constexpr bool traps = std::numeric_limits::traps; static constexpr bool tinyness_before = true; // Member functions @@ -2250,6 +2240,59 @@ struct numeric_limits static constexpr auto denorm_min () -> boost::decimal::decimal64_t { return {1, boost::decimal::detail::etiny_v}; } }; +#if !defined(__cpp_inline_variables) || __cpp_inline_variables < 201606L + +template constexpr bool numeric_limits_impl64::is_specialized; +template constexpr bool numeric_limits_impl64::is_signed; +template constexpr bool numeric_limits_impl64::is_integer; +template constexpr bool numeric_limits_impl64::is_exact; +template constexpr bool numeric_limits_impl64::has_infinity; +template constexpr bool numeric_limits_impl64::has_quiet_NaN; +template constexpr bool numeric_limits_impl64::has_signaling_NaN; + +// These members were deprecated in C++23 +#if ((!defined(_MSC_VER) && (__cplusplus <= 202002L)) || (defined(_MSC_VER) && (_MSVC_LANG <= 202002L))) +template constexpr std::float_denorm_style numeric_limits_impl64::has_denorm; +template constexpr bool numeric_limits_impl64::has_denorm_loss; +#endif + +template constexpr std::float_round_style numeric_limits_impl64::round_style; +template constexpr bool numeric_limits_impl64::is_iec559; +template constexpr bool numeric_limits_impl64::is_bounded; +template constexpr bool numeric_limits_impl64::is_modulo; +template constexpr int numeric_limits_impl64::digits; +template constexpr int numeric_limits_impl64::digits10; +template constexpr int numeric_limits_impl64::max_digits10; +template constexpr int numeric_limits_impl64::radix; +template constexpr int numeric_limits_impl64::min_exponent; +template constexpr int numeric_limits_impl64::min_exponent10; +template constexpr int numeric_limits_impl64::max_exponent; +template constexpr int numeric_limits_impl64::max_exponent10; +template constexpr bool numeric_limits_impl64::traps; +template constexpr bool numeric_limits_impl64::tinyness_before; + +#endif // !defined(__cpp_inline_variables) || __cpp_inline_variables < 201606L + +} // namespace detail + +} //namespace decimal +} //namespace boost + +namespace std { + +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmismatched-tags" +#endif + +template <> +class numeric_limits : + public boost::decimal::detail::numeric_limits_impl64 {}; + +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + } // Namespace std #include diff --git a/include/boost/decimal/decimal_fast128_t.hpp b/include/boost/decimal/decimal_fast128_t.hpp index ecd94ea54..c7470c3c9 100644 --- a/include/boost/decimal/decimal_fast128_t.hpp +++ b/include/boost/decimal/decimal_fast128_t.hpp @@ -1577,22 +1577,12 @@ constexpr auto quantized128f(const decimal_fast128_t& lhs, const decimal_fast128 return {lhs.full_significand(), rhs.biased_exponent(), lhs.isneg()}; } -} // namespace decimal -} // namespace boost - -namespace std { +namespace detail { -template<> -#ifdef _MSC_VER -class numeric_limits -#else -struct numeric_limits -#endif +template +class numeric_limits_impl128f { - -#ifdef _MSC_VER - public: -#endif +public: static constexpr bool is_specialized = true; static constexpr bool is_signed = true; @@ -1620,7 +1610,7 @@ struct numeric_limits static constexpr int min_exponent10 = min_exponent; static constexpr int max_exponent = 6144; static constexpr int max_exponent10 = max_exponent; - static constexpr bool traps = numeric_limits::traps; + static constexpr bool traps = std::numeric_limits::traps; static constexpr bool tinyness_before = true; // Member functions @@ -1635,6 +1625,59 @@ struct numeric_limits static constexpr auto denorm_min () -> boost::decimal::decimal_fast128_t { return min(); } }; +#if !defined(__cpp_inline_variables) || __cpp_inline_variables < 201606L + +template constexpr bool numeric_limits_impl128f::is_specialized; +template constexpr bool numeric_limits_impl128f::is_signed; +template constexpr bool numeric_limits_impl128f::is_integer; +template constexpr bool numeric_limits_impl128f::is_exact; +template constexpr bool numeric_limits_impl128f::has_infinity; +template constexpr bool numeric_limits_impl128f::has_quiet_NaN; +template constexpr bool numeric_limits_impl128f::has_signaling_NaN; + +// These members were deprecated in C++23 +#if ((!defined(_MSC_VER) && (__cplusplus <= 202002L)) || (defined(_MSC_VER) && (_MSVC_LANG <= 202002L))) +template constexpr std::float_denorm_style numeric_limits_impl128f::has_denorm; +template constexpr bool numeric_limits_impl128f::has_denorm_loss; +#endif + +template constexpr std::float_round_style numeric_limits_impl128f::round_style; +template constexpr bool numeric_limits_impl128f::is_iec559; +template constexpr bool numeric_limits_impl128f::is_bounded; +template constexpr bool numeric_limits_impl128f::is_modulo; +template constexpr int numeric_limits_impl128f::digits; +template constexpr int numeric_limits_impl128f::digits10; +template constexpr int numeric_limits_impl128f::max_digits10; +template constexpr int numeric_limits_impl128f::radix; +template constexpr int numeric_limits_impl128f::min_exponent; +template constexpr int numeric_limits_impl128f::min_exponent10; +template constexpr int numeric_limits_impl128f::max_exponent; +template constexpr int numeric_limits_impl128f::max_exponent10; +template constexpr bool numeric_limits_impl128f::traps; +template constexpr bool numeric_limits_impl128f::tinyness_before; + +#endif // !defined(__cpp_inline_variables) || __cpp_inline_variables < 201606L + +} // namespace detail + +} // namespace decimal +} // namespace boost + +namespace std { + +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmismatched-tags" +#endif + +template <> +class numeric_limits : + public boost::decimal::detail::numeric_limits_impl128f {}; + +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + } // namespace std #include diff --git a/include/boost/decimal/decimal_fast32_t.hpp b/include/boost/decimal/decimal_fast32_t.hpp index 11de1002d..b618c8774 100644 --- a/include/boost/decimal/decimal_fast32_t.hpp +++ b/include/boost/decimal/decimal_fast32_t.hpp @@ -1539,22 +1539,12 @@ constexpr auto quantized32f(const decimal_fast32_t lhs, const decimal_fast32_t r return {lhs.full_significand(), rhs.biased_exponent(), lhs.isneg()}; } -} // namespace decimal -} // namespace boost - -namespace std { +namespace detail { -template <> -#ifdef _MSC_VER -class numeric_limits -#else -struct numeric_limits -#endif +template +class numeric_limits_impl32f { - -#ifdef _MSC_VER - public: -#endif +public: static constexpr bool is_specialized = true; static constexpr bool is_signed = true; @@ -1582,7 +1572,7 @@ struct numeric_limits static constexpr int min_exponent10 = min_exponent; static constexpr int max_exponent = 96; static constexpr int max_exponent10 = max_exponent; - static constexpr bool traps = numeric_limits::traps; + static constexpr bool traps = std::numeric_limits::traps; static constexpr bool tinyness_before = true; // Member functions @@ -1599,6 +1589,59 @@ struct numeric_limits static constexpr auto denorm_min () -> boost::decimal::decimal_fast32_t { return min(); } }; +#if !defined(__cpp_inline_variables) || __cpp_inline_variables < 201606L + +template constexpr bool numeric_limits_impl32f::is_specialized; +template constexpr bool numeric_limits_impl32f::is_signed; +template constexpr bool numeric_limits_impl32f::is_integer; +template constexpr bool numeric_limits_impl32f::is_exact; +template constexpr bool numeric_limits_impl32f::has_infinity; +template constexpr bool numeric_limits_impl32f::has_quiet_NaN; +template constexpr bool numeric_limits_impl32f::has_signaling_NaN; + +// These members were deprecated in C++23 +#if ((!defined(_MSC_VER) && (__cplusplus <= 202002L)) || (defined(_MSC_VER) && (_MSVC_LANG <= 202002L))) +template constexpr std::float_denorm_style numeric_limits_impl32f::has_denorm; +template constexpr bool numeric_limits_impl32f::has_denorm_loss; +#endif + +template constexpr std::float_round_style numeric_limits_impl32f::round_style; +template constexpr bool numeric_limits_impl32f::is_iec559; +template constexpr bool numeric_limits_impl32f::is_bounded; +template constexpr bool numeric_limits_impl32f::is_modulo; +template constexpr int numeric_limits_impl32f::digits; +template constexpr int numeric_limits_impl32f::digits10; +template constexpr int numeric_limits_impl32f::max_digits10; +template constexpr int numeric_limits_impl32f::radix; +template constexpr int numeric_limits_impl32f::min_exponent; +template constexpr int numeric_limits_impl32f::min_exponent10; +template constexpr int numeric_limits_impl32f::max_exponent; +template constexpr int numeric_limits_impl32f::max_exponent10; +template constexpr bool numeric_limits_impl32f::traps; +template constexpr bool numeric_limits_impl32f::tinyness_before; + +#endif // !defined(__cpp_inline_variables) || __cpp_inline_variables < 201606L + +} // namespace detail + +} // namespace decimal +} // namespace boost + +namespace std { + +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmismatched-tags" +#endif + +template <> +class numeric_limits : + public boost::decimal::detail::numeric_limits_impl32f {}; + +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + } // Namespace std #include diff --git a/include/boost/decimal/decimal_fast64_t.hpp b/include/boost/decimal/decimal_fast64_t.hpp index a7ba82332..7931e7c2e 100644 --- a/include/boost/decimal/decimal_fast64_t.hpp +++ b/include/boost/decimal/decimal_fast64_t.hpp @@ -1513,21 +1513,12 @@ constexpr auto copysignd64f(decimal_fast64_t mag, const decimal_fast64_t sgn) no return mag; } -} // namespace decimal -} // namespace boost - -namespace std { +namespace detail { -template <> -#ifdef _MSC_VER -class numeric_limits -#else -struct numeric_limits -#endif +template +class numeric_limits_impl64f { -#ifdef _MSC_VER - public: -#endif +public: static constexpr bool is_specialized = true; static constexpr bool is_signed = true; @@ -1555,7 +1546,7 @@ struct numeric_limits static constexpr int min_exponent10 = min_exponent; static constexpr int max_exponent = 384; static constexpr int max_exponent10 = max_exponent; - static constexpr bool traps = numeric_limits::traps; + static constexpr bool traps = std::numeric_limits::traps; static constexpr bool tinyness_before = true; // Member functions @@ -1573,6 +1564,59 @@ struct numeric_limits static constexpr auto denorm_min () -> boost::decimal::decimal_fast64_t { return min(); } }; +#if !defined(__cpp_inline_variables) || __cpp_inline_variables < 201606L + +template constexpr bool numeric_limits_impl64f::is_specialized; +template constexpr bool numeric_limits_impl64f::is_signed; +template constexpr bool numeric_limits_impl64f::is_integer; +template constexpr bool numeric_limits_impl64f::is_exact; +template constexpr bool numeric_limits_impl64f::has_infinity; +template constexpr bool numeric_limits_impl64f::has_quiet_NaN; +template constexpr bool numeric_limits_impl64f::has_signaling_NaN; + +// These members were deprecated in C++23 +#if ((!defined(_MSC_VER) && (__cplusplus <= 202002L)) || (defined(_MSC_VER) && (_MSVC_LANG <= 202002L))) +template constexpr std::float_denorm_style numeric_limits_impl64f::has_denorm; +template constexpr bool numeric_limits_impl64f::has_denorm_loss; +#endif + +template constexpr std::float_round_style numeric_limits_impl64f::round_style; +template constexpr bool numeric_limits_impl64f::is_iec559; +template constexpr bool numeric_limits_impl64f::is_bounded; +template constexpr bool numeric_limits_impl64f::is_modulo; +template constexpr int numeric_limits_impl64f::digits; +template constexpr int numeric_limits_impl64f::digits10; +template constexpr int numeric_limits_impl64f::max_digits10; +template constexpr int numeric_limits_impl64f::radix; +template constexpr int numeric_limits_impl64f::min_exponent; +template constexpr int numeric_limits_impl64f::min_exponent10; +template constexpr int numeric_limits_impl64f::max_exponent; +template constexpr int numeric_limits_impl64f::max_exponent10; +template constexpr bool numeric_limits_impl64f::traps; +template constexpr bool numeric_limits_impl64f::tinyness_before; + +#endif // !defined(__cpp_inline_variables) || __cpp_inline_variables < 201606L + +} // namespace detail + +} // namespace decimal +} // namespace boost + +namespace std { + +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmismatched-tags" +#endif + +template <> +class numeric_limits : + public boost::decimal::detail::numeric_limits_impl64f {}; + +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + } // namespace std #include diff --git a/include/boost/decimal/fwd.hpp b/include/boost/decimal/fwd.hpp index 3a519b1c2..3f7649bba 100644 --- a/include/boost/decimal/fwd.hpp +++ b/include/boost/decimal/fwd.hpp @@ -25,46 +25,31 @@ class decimal_fast128_t; namespace std { +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmismatched-tags" +#endif + template <> -#ifdef _MSC_VER class numeric_limits; -#else -struct numeric_limits; -#endif template <> -#ifdef _MSC_VER class numeric_limits; -#else -struct numeric_limits; -#endif template <> -#ifdef _MSC_VER class numeric_limits; -#else -struct numeric_limits; -#endif template <> -#ifdef _MSC_VER class numeric_limits; -#else -struct numeric_limits; -#endif template <> -#ifdef _MSC_VER class numeric_limits; -#else -struct numeric_limits; -#endif template <> -#ifdef _MSC_VER class numeric_limits; -#else -struct numeric_limits; + +#ifdef __clang__ +# pragma clang diagnostic pop #endif } // Namespace std diff --git a/modules/decimal.cxx b/modules/decimal.cxx index d77f323f2..f6657812a 100644 --- a/modules/decimal.cxx +++ b/modules/decimal.cxx @@ -81,46 +81,22 @@ class decimal_fast128_t; export namespace std { template <> -#ifdef _MSC_VER class numeric_limits; -#else -struct numeric_limits; -#endif template <> -#ifdef _MSC_VER -class numeric_limits; -#else -struct numeric_limits; -#endif +class numeric_limits; template <> -#ifdef _MSC_VER -class numeric_limits; -#else -struct numeric_limits; -#endif +class numeric_limits; template <> -#ifdef _MSC_VER -class numeric_limits; -#else -struct numeric_limits; -#endif +class numeric_limits; template <> -#ifdef _MSC_VER -class numeric_limits; -#else -struct numeric_limits; -#endif +class numeric_limits; template <> -#ifdef _MSC_VER class numeric_limits; -#else -struct numeric_limits; -#endif } // Namespace std diff --git a/test/Jamfile b/test/Jamfile index 591c0cc7b..7cc8df1cc 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -187,6 +187,8 @@ run test_to_string.cpp ; run test_total_ordering.cpp ; run test_zeta.cpp ; +run limits_link_1.cpp limits_link_2.cpp limits_link_3.cpp ; + # Run the examples too run ../examples/adl.cpp ; run ../examples/basic_construction.cpp ; diff --git a/test/limits_link_1.cpp b/test/limits_link_1.cpp new file mode 100644 index 000000000..ccd990a0c --- /dev/null +++ b/test/limits_link_1.cpp @@ -0,0 +1,26 @@ +// Copyright 2023 Peter Dimov +// Copyright 2025 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include +#include + +void test_odr_use( int const* ); + +template void test() +{ + test_odr_use( &boost::decimal::limits::max_chars ); + test_odr_use( &std::numeric_limits::digits10 ); +} + +void f1() +{ + test(); + test(); + test(); + + test(); + test(); + test(); +} diff --git a/test/limits_link_2.cpp b/test/limits_link_2.cpp new file mode 100644 index 000000000..b40dd60b4 --- /dev/null +++ b/test/limits_link_2.cpp @@ -0,0 +1,26 @@ +// Copyright 2023 Peter Dimov +// Copyright 2025 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include +#include + +void test_odr_use( int const* ); + +template void test() +{ + test_odr_use( &boost::decimal::limits::max_chars ); + test_odr_use( &std::numeric_limits::digits10 ); +} + +void f2() +{ + test(); + test(); + test(); + + test(); + test(); + test(); +} diff --git a/test/limits_link_3.cpp b/test/limits_link_3.cpp new file mode 100644 index 000000000..e2bb12904 --- /dev/null +++ b/test/limits_link_3.cpp @@ -0,0 +1,16 @@ +// Copyright 2023 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +void f1(); +void f2(); + +int main() +{ + f1(); + f2(); +} + +void test_odr_use( int const* ) +{ +}