[libc-commits] [libc] 0abce1e - [libc] add <limits> specialization for signed char

via libc-commits libc-commits at lists.llvm.org
Tue Aug 8 08:04:59 PDT 2023


Author: Guillaume Chatelet
Date: 2023-08-08T17:04:55+02:00
New Revision: 0abce1e4a5bb53985b64aac7a5b34f723c04aac8

URL: https://github.com/llvm/llvm-project/commit/0abce1e4a5bb53985b64aac7a5b34f723c04aac8
DIFF: https://github.com/llvm/llvm-project/commit/0abce1e4a5bb53985b64aac7a5b34f723c04aac8.diff

LOG: [libc] add <limits> specialization for signed char

Added: 
    

Modified: 
    libc/src/__support/CPP/limits.h

Removed: 
    


################################################################################
diff  --git a/libc/src/__support/CPP/limits.h b/libc/src/__support/CPP/limits.h
index 225bf6ee7770d4..dce0bebdd2cd2c 100644
--- a/libc/src/__support/CPP/limits.h
+++ b/libc/src/__support/CPP/limits.h
@@ -67,6 +67,11 @@ template <> class numeric_limits<char> {
   static constexpr char max() { return CHAR_MAX; }
   static constexpr char min() { return CHAR_MIN; }
 };
+template <> class numeric_limits<signed char> {
+public:
+  static constexpr signed char max() { return SCHAR_MAX; }
+  static constexpr signed char min() { return SCHAR_MIN; }
+};
 template <> class numeric_limits<unsigned char> {
 public:
   static constexpr unsigned char max() { return UCHAR_MAX; }


        


More information about the libc-commits mailing list