From 7eab29c40abbe8c7e72a59f654462a9063938648 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Wed, 4 Dec 2024 21:14:17 +0100 Subject: [PATCH] fix: gcc-12 compilation workaround --- .../mp-units/framework/representation_concepts.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/core/include/mp-units/framework/representation_concepts.h b/src/core/include/mp-units/framework/representation_concepts.h index 3ab804dcf..ff99bd96d 100644 --- a/src/core/include/mp-units/framework/representation_concepts.h +++ b/src/core/include/mp-units/framework/representation_concepts.h @@ -82,11 +82,16 @@ concept ScalableWith = requires(const T v, const S s) { }; template -concept Scalar = (!disable_scalar) && requires(const T a, const T b) { - { -a } -> std::common_with; - { a + b } -> std::common_with; - { a - b } -> std::common_with; -} && ScalableWith && WeaklyRegular; +concept Scalar = (!disable_scalar) && + requires(const T a, const T b) { + { -a } -> std::common_with; + { a + b } -> std::common_with; + { a - b } -> std::common_with; + } && ScalableWith +#if MP_UNITS_COMP_GCC != 12 + && WeaklyRegular +#endif + ; namespace real_impl {