From b4810089ec271f0863d778e64ed30642ba315ee6 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Sat, 9 Nov 2024 23:02:12 +0100 Subject: [PATCH] fix: gcc-12 compilation fixed Resolves #632 --- src/core/include/mp-units/framework/expression_template.h | 8 +++++--- .../include/mp-units/framework/quantity_spec_concepts.h | 4 ++-- test/static/custom_rep_test_min_impl.cpp | 2 +- test/static/si_test.cpp | 3 ++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/core/include/mp-units/framework/expression_template.h b/src/core/include/mp-units/framework/expression_template.h index 3448bb33..b0d2138f 100644 --- a/src/core/include/mp-units/framework/expression_template.h +++ b/src/core/include/mp-units/framework/expression_template.h @@ -48,9 +48,11 @@ template concept SymbolicArg = (!std::is_const_v) && (!std::is_reference_v); template -concept SymbolicConstant = - SymbolicArg && std::is_empty_v && std::is_trivial_v && std::semiregular && std::is_final_v; - +concept SymbolicConstant = SymbolicArg && std::is_empty_v && std::is_trivial_v && +#if !MP_UNITS_COMP_GCC || MP_UNITS_COMP_GCC > 12 + std::semiregular && +#endif + std::is_final_v; /** * @brief Type list type used by the expression template framework diff --git a/src/core/include/mp-units/framework/quantity_spec_concepts.h b/src/core/include/mp-units/framework/quantity_spec_concepts.h index 6e7e0934..09260efa 100644 --- a/src/core/include/mp-units/framework/quantity_spec_concepts.h +++ b/src/core/include/mp-units/framework/quantity_spec_concepts.h @@ -117,8 +117,8 @@ concept ChildQuantitySpecOf = (is_child_of(Child, Parent)); template concept NestedQuantityKindSpecOf = - QuantitySpec && QuantitySpec && (!SameQuantitySpec) && - ChildQuantitySpecOf; + QuantitySpec && QuantitySpec && + (!SameQuantitySpec) && ChildQuantitySpecOf; template concept QuantitySpecConvertibleTo = diff --git a/test/static/custom_rep_test_min_impl.cpp b/test/static/custom_rep_test_min_impl.cpp index 4fb2537b..e2810eaa 100644 --- a/test/static/custom_rep_test_min_impl.cpp +++ b/test/static/custom_rep_test_min_impl.cpp @@ -86,7 +86,7 @@ static_assert(!std::convertible_to, quantity -concept creates_quantity = Unit && requires { T{} * U; }; +concept creates_quantity = Unit && requires { T{} * U; }; static_assert(creates_quantity, si::metre>); static_assert(creates_quantity, si::metre>); diff --git a/test/static/si_test.cpp b/test/static/si_test.cpp index 4f306fd2..40a9e411 100644 --- a/test/static/si_test.cpp +++ b/test/static/si_test.cpp @@ -61,7 +61,8 @@ static_assert(1 * Qm == 1'000'000'000'000'000'000 * Tm); // check for invalid prefixes template typename prefix, auto V1> -concept can_not_be_prefixed = Unit && !requires { typename prefix; }; +concept can_not_be_prefixed = + Unit && !requires { typename prefix; }; static_assert(can_not_be_prefixed); static_assert(can_not_be_prefixed);