public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/ARM/heads/morello)] libstdc++: Add some intcap type handling
@ 2022-09-05 10:09 Alex Coplan
0 siblings, 0 replies; only message in thread
From: Alex Coplan @ 2022-09-05 10:09 UTC (permalink / raw)
To: gcc-cvs, libstdc++-cvs
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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-05 10:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-05 10:09 [gcc(refs/vendors/ARM/heads/morello)] libstdc++: Add some intcap type handling Alex Coplan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).