diff --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst --- a/libcxx/docs/ReleaseNotes.rst +++ b/libcxx/docs/ReleaseNotes.rst @@ -78,6 +78,12 @@ exceeds the maximum supported size, as required by the C++ standard. Previously the type ``std::length_error`` was used. +ABI Changes +----------- + +- The C++17 variable templates ``is_error_code_enum_v`` and + ``is_error_condition_enum_v`` are now of type ``bool`` instead of ``size_t``. + Build System Changes -------------------- diff --git a/libcxx/include/system_error b/libcxx/include/system_error --- a/libcxx/include/system_error +++ b/libcxx/include/system_error @@ -46,10 +46,10 @@ : public false_type {}; template -inline constexpr size_t is_error_condition_enum_v = is_error_condition_enum<_Tp>::value; // C++17 +inline constexpr bool is_error_condition_enum_v = is_error_condition_enum<_Tp>::value; // C++17 template -inline constexpr size_t is_error_code_enum_v = is_error_code_enum<_Tp>::value; // C++17 +inline constexpr bool is_error_code_enum_v = is_error_code_enum<_Tp>::value; // C++17 class error_code { @@ -165,7 +165,7 @@ #if _LIBCPP_STD_VER > 14 template -inline constexpr size_t is_error_code_enum_v = is_error_code_enum<_Tp>::value; +inline constexpr bool is_error_code_enum_v = is_error_code_enum<_Tp>::value; #endif // is_error_condition_enum @@ -176,7 +176,7 @@ #if _LIBCPP_STD_VER > 14 template -inline constexpr size_t is_error_condition_enum_v = is_error_condition_enum<_Tp>::value; +inline constexpr bool is_error_condition_enum_v = is_error_condition_enum<_Tp>::value; #endif template <> diff --git a/libcxx/test/std/diagnostics/syserr/is_error_code_enum.pass.cpp b/libcxx/test/std/diagnostics/syserr/is_error_code_enum.pass.cpp --- a/libcxx/test/std/diagnostics/syserr/is_error_code_enum.pass.cpp +++ b/libcxx/test/std/diagnostics/syserr/is_error_code_enum.pass.cpp @@ -23,6 +23,7 @@ static_assert((std::is_error_code_enum::value == Expected), ""); #if TEST_STD_VER > 14 static_assert((std::is_error_code_enum_v == Expected), ""); + ASSERT_SAME_TYPE(decltype(std::is_error_code_enum_v), const bool); #endif } diff --git a/libcxx/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp b/libcxx/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp --- a/libcxx/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp +++ b/libcxx/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp @@ -23,6 +23,7 @@ static_assert((std::is_error_condition_enum::value == Expected), ""); #if TEST_STD_VER > 14 static_assert((std::is_error_condition_enum_v == Expected), ""); + ASSERT_SAME_TYPE(decltype(std::is_error_condition_enum_v), const bool); #endif }