public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: Alex Coplan <acoplan@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/morello)] libstdc++: Add some intcap type handling Date: Mon, 5 Sep 2022 10:09:28 +0000 (GMT) [thread overview] Message-ID: <20220905100928.A23EC3858D32@sourceware.org> (raw) 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)
reply other threads:[~2022-09-05 10:09 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220905100928.A23EC3858D32@sourceware.org \ --to=acoplan@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).