[gcc(refs/vendors/ARM/heads/morello)] libstdc++: Add some intcap type handling
Alex Coplan
acoplan@gcc.gnu.org
Mon Sep 5 10:09:28 GMT 2022
https://gcc.gnu.org/g:46c0f36ba7dc0c1d8d992f6ccfe24b7f863b5688
commit 46c0f36ba7dc0c1d8d992f6ccfe24b7f863b5688
Author: Alex Coplan <alex.coplan@arm.com>
Date: Mon Aug 8 15:20:09 2022 +0100
libstdc++: Add some intcap type handling
This extends std::numeric_limits and std::is_integral to handle intcap
types.
Diff:
---
libstdc++-v3/include/std/limits | 10 ++++++++++
libstdc++-v3/include/std/type_traits | 10 ++++++++++
2 files changed, 20 insertions(+)
diff --git a/libstdc++-v3/include/std/limits b/libstdc++-v3/include/std/limits
index 20883ba6403..2a4b68f55d5 100644
--- a/libstdc++-v3/include/std/limits
+++ b/libstdc++-v3/include/std/limits
@@ -1477,6 +1477,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
= round_toward_zero;
};
+#ifdef __CHERI__
+ template<>
+ struct numeric_limits<__intcap>
+ : public numeric_limits<long> { };
+
+ template<>
+ struct numeric_limits<unsigned __intcap>
+ : public numeric_limits<unsigned long> { };
+#endif
+
#define __INT_N(TYPE, BITSIZE, EXT, UEXT) \
template<> \
struct numeric_limits<TYPE> \
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index 6ced781bd59..46e8693b1df 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -321,6 +321,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct __is_integral_helper<unsigned long long>
: public true_type { };
+#ifdef __CHERI__
+ template<>
+ struct __is_integral_helper<__intcap>
+ : public true_type { };
+
+ template<>
+ struct __is_integral_helper<unsigned __intcap>
+ : public true_type { };
+#endif
+
// Conditionalizing on __STRICT_ANSI__ here will break any port that
// uses one of these types for size_t.
#if defined(__GLIBCXX_TYPE_INT_N_0)
More information about the Gcc-cvs
mailing list