summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2018-11-29 23:21:18 +0000
committerMarshall Clow <mclow.lists@gmail.com>2018-11-29 23:21:18 +0000
commita815a3f8ccb1c9346dab7b8a55c6e96073200a63 (patch)
tree16428e383fcb60788fc4a4f01b4ae7f59ebbe18a /include
parent8e2d4ad9c5c1c1d7c2d4ea723e3f897c7195d3b6 (diff)
downloadexternal_libcxx-a815a3f8ccb1c9346dab7b8a55c6e96073200a63.tar.gz
external_libcxx-a815a3f8ccb1c9346dab7b8a55c6e96073200a63.tar.bz2
external_libcxx-a815a3f8ccb1c9346dab7b8a55c6e96073200a63.zip
First part of P0482 - Establish that char8_t is an integral type, and that numeric_limits<char8_t> is valid and sane. (second try)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347930 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/limits1
-rw-r--r--include/type_traits3
2 files changed, 4 insertions, 0 deletions
diff --git a/include/limits b/include/limits
index f530507f7..5b75f4a9e 100644
--- a/include/limits
+++ b/include/limits
@@ -82,6 +82,7 @@ template<> class numeric_limits<cv char>;
template<> class numeric_limits<cv signed char>;
template<> class numeric_limits<cv unsigned char>;
template<> class numeric_limits<cv wchar_t>;
+template<> class numeric_limits<cv char8_t>; // C++20
template<> class numeric_limits<cv char16_t>;
template<> class numeric_limits<cv char32_t>;
diff --git a/include/type_traits b/include/type_traits
index aadb97ba9..09c001970 100644
--- a/include/type_traits
+++ b/include/type_traits
@@ -709,6 +709,9 @@ template <> struct __libcpp_is_integral<char> : public tr
template <> struct __libcpp_is_integral<signed char> : public true_type {};
template <> struct __libcpp_is_integral<unsigned char> : public true_type {};
template <> struct __libcpp_is_integral<wchar_t> : public true_type {};
+#if _LIBCPP_STD_VER > 17 && defined(__cpp_char8_t)
+template <> struct __libcpp_is_integral<char8_t> : public true_type {};
+#endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
template <> struct __libcpp_is_integral<char16_t> : public true_type {};
template <> struct __libcpp_is_integral<char32_t> : public true_type {};