diff --git a/libcxx/include/compare b/libcxx/include/compare --- a/libcxx/include/compare +++ b/libcxx/include/compare @@ -126,7 +126,6 @@ #include <__config> #include -#include #ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER #pragma GCC system_header @@ -701,8 +700,8 @@ template constexpr _ClassifyCompCategory -__compute_comp_type(array<_ClassifyCompCategory, _Size> __types) { - array __seen = {}; +__compute_comp_type(const _ClassifyCompCategory (&__types)[_Size]) { + int __seen[_CCC_Size] = {}; for (auto __type : __types) ++__seen[__type]; if (__seen[_None]) @@ -723,9 +722,8 @@ template constexpr auto __get_comp_type() { using _CCC = _ClassifyCompCategory; - constexpr array<_CCC, sizeof...(_Ts)> __type_kinds{{__comp_detail::__type_to_enum<_Ts>()...}}; - constexpr _CCC _Cat = sizeof...(_Ts) == 0 ? _StrongOrd - : __compute_comp_type(__type_kinds); + constexpr _CCC __type_kinds[] = {_StrongOrd, __type_to_enum<_Ts>()...}; + constexpr _CCC _Cat = __compute_comp_type(__type_kinds); if constexpr (_Cat == _None) return void(); else if constexpr (_Cat == _WeakEq)