[libcxx-commits] [PATCH] D112553: [libc++][ABI Break] Make is_error_condition_enum_v and is_error_code_enum_v bool, not size_t

Joe Loser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 28 12:24:23 PDT 2021


jloser updated this revision to Diff 383119.
jloser retitled this revision from "[libc++] Make is_error_condition_enum_v and is_error_code_enum_v bool, not size_t" to "[libc++][ABI Break] Make is_error_condition_enum_v and is_error_code_enum_v bool, not size_t".
jloser edited the summary of this revision.
jloser added a comment.

Add release note detailing the ABI break


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112553/new/

https://reviews.llvm.org/D112553

Files:
  libcxx/docs/ReleaseNotes.rst
  libcxx/include/system_error
  libcxx/test/std/diagnostics/syserr/is_error_code_enum.pass.cpp
  libcxx/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp


Index: libcxx/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp
===================================================================
--- libcxx/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp
+++ libcxx/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp
@@ -23,6 +23,7 @@
     static_assert((std::is_error_condition_enum<T>::value == Expected), "");
 #if TEST_STD_VER > 14
     static_assert((std::is_error_condition_enum_v<T>        == Expected), "");
+    ASSERT_SAME_TYPE(decltype(std::is_error_condition_enum_v<T>), const bool);
 #endif
 }
 
Index: libcxx/test/std/diagnostics/syserr/is_error_code_enum.pass.cpp
===================================================================
--- libcxx/test/std/diagnostics/syserr/is_error_code_enum.pass.cpp
+++ libcxx/test/std/diagnostics/syserr/is_error_code_enum.pass.cpp
@@ -23,6 +23,7 @@
     static_assert((std::is_error_code_enum<T>::value == Expected), "");
 #if TEST_STD_VER > 14
     static_assert((std::is_error_code_enum_v<T>      == Expected), "");
+    ASSERT_SAME_TYPE(decltype(std::is_error_code_enum_v<T>), const bool);
 #endif
 }
 
Index: libcxx/include/system_error
===================================================================
--- libcxx/include/system_error
+++ libcxx/include/system_error
@@ -46,10 +46,10 @@
     : public false_type {};
 
 template <class _Tp>
-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 <class _Tp>
-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 <class _Tp>
-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 <class _Tp>
-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 <>
Index: libcxx/docs/ReleaseNotes.rst
===================================================================
--- libcxx/docs/ReleaseNotes.rst
+++ 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
 --------------------
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112553.383119.patch
Type: text/x-patch
Size: 2858 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211028/5c7c298f/attachment.bin>


More information about the libcxx-commits mailing list