public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Arsen Arsenović" <arsen@aarsen.me>
To: gcc-patches@gcc.gnu.org
Cc: libstdc++@gcc.gnu.org, "Arsen Arsenović" <arsen@aarsen.me>
Subject: [PATCH 1/2] libstdc++: declare std::allocator in !HOSTED as an extension
Date: Thu,  9 Nov 2023 20:25:34 +0100	[thread overview]
Message-ID: <20231109193009.2391070-1-arsen@aarsen.me> (raw)

This allows us to add features to freestanding which allow specifying
non-default allocators (generators, collections, ...) without having to
modify them.

libstdc++-v3/ChangeLog:

	* include/bits/memoryfwd.h: Remove HOSTED check around allocator
	and its specializations.
---
Evening,

This patch adds std::allocator as a declaration to freestanding, so that
it doesn't block various other bits of the library (such as collections
or the generators that I intend to send in soon) from being added to
freestanding anymore.

I don't intend to pull in anything but <generator> into freestanding
in this release, though, so, this patch will have little impact for now.

Testing on x86_64-pc-linux-gnu (the tests are not done yet, but I see no
relevant fails in previous test runs).  The follow-up patch also marks a
new test as freestanding (as it was failing).

OK for trunk?

Have a lovely evening!

 libstdc++-v3/include/bits/memoryfwd.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libstdc++-v3/include/bits/memoryfwd.h b/libstdc++-v3/include/bits/memoryfwd.h
index 330a6df7f44a..2b79cd8880a1 100644
--- a/libstdc++-v3/include/bits/memoryfwd.h
+++ b/libstdc++-v3/include/bits/memoryfwd.h
@@ -60,13 +60,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    * @{
    */
 
-#if _GLIBCXX_HOSTED
+  // Included in freestanding as a libstdc++ extension.
   template<typename>
     class allocator;
 
   template<>
     class allocator<void>;
-#endif
 
 #if __cplusplus >= 201103L
   /// Declare uses_allocator so it can be specialized in `<queue>` etc.
-- 
2.42.1


             reply	other threads:[~2023-11-09 19:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 19:25 Arsen Arsenović [this message]
2023-11-09 19:25 ` [PATCH 2/2] libstdc++: mark 20_util/scoped_allocator/noexcept.cc R-E-T hosted Arsen Arsenović
2023-11-09 19:34   ` Jonathan Wakely
2023-11-09 23:07 ` [PATCH 1/2] libstdc++: declare std::allocator in !HOSTED as an extension Jonathan Wakely
2023-11-09 23:09   ` Arsen Arsenović

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=20231109193009.2391070-1-arsen@aarsen.me \
    --to=arsen@aarsen.me \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@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: link
Be 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).