diff --git a/src/core/include/mp-units/bits/expression_template.h b/src/core/include/mp-units/bits/expression_template.h index 03727e4e6..fedbef0c3 100644 --- a/src/core/include/mp-units/bits/expression_template.h +++ b/src/core/include/mp-units/bits/expression_template.h @@ -348,9 +348,6 @@ template typename To> -using expr_make_spec = decltype(expr_make_spec_impl()); - template typename Pred, template typename To> [[nodiscard]] consteval auto get_optimized_expression() @@ -358,8 +355,9 @@ template; using den_list = expr_consolidate; using simple = expr_simplify; - using expr = expr_make_spec; - return expr{}; + // the usage of `std::identity` below helps to resolve an using alias identifier to the actual + // type identifier in the clang compile-time errors + return std::identity{}(expr_make_spec_impl()); } /** @@ -444,7 +442,9 @@ template typename To, typename OneType, typename T> [[nodiscard]] consteval auto expr_invert(T) { if constexpr (is_specialization_of) - return expr_make_spec{}; + // the usage of `std::identity` below helps to resolve an using alias identifier to the actual + // type identifier in the clang compile-time errors + return std::identity{}(expr_make_spec_impl()); else return To>{}; }