From 94bd2a23cae7006460dd544956c716e204edbb0c Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 26 Sep 2023 18:25:03 +0200 Subject: [PATCH] build: got rid of old gcc hacks --- .../include/mp-units/bits/external/hacks.h | 22 +------------------ test/unit_test/static/quantity_point_test.cpp | 2 -- test/unit_test/static/quantity_test.cpp | 6 ----- 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/src/core/include/mp-units/bits/external/hacks.h b/src/core/include/mp-units/bits/external/hacks.h index b685e5540..f943dc25e 100644 --- a/src/core/include/mp-units/bits/external/hacks.h +++ b/src/core/include/mp-units/bits/external/hacks.h @@ -96,31 +96,11 @@ #if MP_UNITS_COMP_MSVC #define MP_UNITS_CONSTRAINED_AUTO_WORKAROUND(X) - -#else - -#define MP_UNITS_CONSTRAINED_AUTO_WORKAROUND(X) X - -#endif - -#if MP_UNITS_COMP_MSVC || (MP_UNITS_COMP_GCC && MP_UNITS_COMP_GCC < 11) - #define MP_UNITS_CONSTRAINED_NTTP_WORKAROUND(X) #else +#define MP_UNITS_CONSTRAINED_AUTO_WORKAROUND(X) X #define MP_UNITS_CONSTRAINED_NTTP_WORKAROUND(X) X #endif - - -namespace std { - -#if MP_UNITS_COMP_GCC - -template -concept default_constructible = constructible_from; - -#endif - -} // namespace std diff --git a/test/unit_test/static/quantity_point_test.cpp b/test/unit_test/static/quantity_point_test.cpp index 520e842f1..41acddebe 100644 --- a/test/unit_test/static/quantity_point_test.cpp +++ b/test/unit_test/static/quantity_point_test.cpp @@ -587,14 +587,12 @@ static_assert((tower_peak + 2. * km).in(km).quantity_from_origin_.numerical_valu static_assert((tower_peak + 2. * km).in(m).quantity_from_origin_.numerical_value_ == 2000.); static_assert((tower_peak + 2000. * m).in(km).quantity_from_origin_.numerical_value_ == 2.); -#if MP_UNITS_COMP_GCC != 10 || MP_UNITS_COMP_GCC_MINOR > 2 template typename QP> concept invalid_unit_conversion = requires { requires !requires { QP(2000 * m).in(km); }; // truncating conversion requires !requires { QP(2 * m).in(s); }; // invalid unit }; static_assert(invalid_unit_conversion); -#endif ///////// diff --git a/test/unit_test/static/quantity_test.cpp b/test/unit_test/static/quantity_test.cpp index ed2ab6e75..60f1e36d4 100644 --- a/test/unit_test/static/quantity_test.cpp +++ b/test/unit_test/static/quantity_test.cpp @@ -45,7 +45,6 @@ static_assert(sizeof(quantity) == sizeof(double)); static_assert(sizeof(quantity) == sizeof(short)); static_assert(sizeof(quantity) == sizeof(short)); -#if MP_UNITS_COMP_GCC != 10 || MP_UNITS_COMP_GCC_MINOR > 2 template typename Q> concept invalid_types = requires { requires !requires { typename Q; }; // dimension instead of reference @@ -55,7 +54,6 @@ concept invalid_types = requires { requires !requires { typename Q; }; // vector representation expected }; static_assert(invalid_types); -#endif static_assert(std::is_trivially_default_constructible_v>); static_assert(std::is_trivially_copy_constructible_v>); @@ -208,14 +206,12 @@ static_assert(quantity(2000. * m).in(km).numerical_value_ == 2.) static_assert(quantity(2 * km).in(km).numerical_value_ == 2); static_assert(quantity(2 * km).in(m).numerical_value_ == 2000); -#if MP_UNITS_COMP_GCC != 10 || MP_UNITS_COMP_GCC_MINOR > 2 template typename Q> concept invalid_unit_conversion = requires { requires !requires { Q(2000 * m).in(km); }; // truncating conversion requires !requires { Q(2 * m).in(s); }; // invalid unit }; static_assert(invalid_unit_conversion); -#endif static_assert(quantity(2. * km).numerical_value_in(km) == 2.); static_assert(quantity(2. * km).numerical_value_in(m) == 2000.); @@ -223,14 +219,12 @@ static_assert(quantity(2000. * m).numerical_value_in(km) == 2.); static_assert(quantity(2 * km).numerical_value_in(km) == 2); static_assert(quantity(2 * km).numerical_value_in(m) == 2000); -#if MP_UNITS_COMP_GCC != 10 || MP_UNITS_COMP_GCC_MINOR > 2 template typename Q> concept invalid_getter_with_unit_conversion = requires { requires !requires { Q(2000 * m).numerical_value_in(km); }; // truncating conversion requires !requires { Q(2 * m).numerical_value_in(s); }; // invalid unit }; static_assert(invalid_getter_with_unit_conversion); -#endif ///////////////////////////////////////