[libcxx-commits] [PATCH] D112553: [libc++] 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
Tue Oct 26 09:07:54 PDT 2021


jloser created this revision.
jloser added reviewers: ldionne, Quuxplusone, Mordante.
jloser requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

`is_error_condition_enum_v` and `is_error_code_enum_v` are currently of
type `size_t`, but the standard mandates they are of type `bool`.

Fixes https://bugs.llvm.org/show_bug.cgi?id=50755


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112553

Files:
  libcxx/include/system_error


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 <>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112553.382357.patch
Type: text/x-patch
Size: 1196 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211026/d195f505/attachment-0001.bin>


More information about the libcxx-commits mailing list