public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r13-3041] libstdc++: Re-enable std::hash<std::bitset> in freestanding [PR103626]
Date: Mon,  3 Oct 2022 14:46:07 +0000 (GMT)	[thread overview]
Message-ID: <20221003144607.5C02B3857C61@sourceware.org> (raw)

https://gcc.gnu.org/g:54fd7d81709c5f50537128d3978b4c642b68a711

commit r13-3041-g54fd7d81709c5f50537128d3978b4c642b68a711
Author: Arsen Arsenović <arsen@aarsen.me>
Date:   Wed Sep 28 21:30:11 2022 +0200

    libstdc++: Re-enable std::hash<std::bitset> in freestanding [PR103626]
    
    PR libstdc++/103626 - _GLIBCXX_HOSTED should respect -ffreestanding
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/103626
            * include/std/bitset [!_GLIBCXX_HOSTED]: Re-enable std::hash.
            * testsuite/20_util/bitset/cons/constexpr_c++23.cc: Require ET
            hosted.
            * testsuite/20_util/bitset/ext/constexpr.cc: Likewise.

Diff:
---
 libstdc++-v3/include/std/bitset                               | 9 +++++----
 libstdc++-v3/testsuite/20_util/bitset/cons/constexpr_c++23.cc | 2 ++
 libstdc++-v3/testsuite/20_util/bitset/ext/constexpr.cc        | 2 ++
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/libstdc++-v3/include/std/bitset b/libstdc++-v3/include/std/bitset
index 1038cc65138..10fb05a1b90 100644
--- a/libstdc++-v3/include/std/bitset
+++ b/libstdc++-v3/include/std/bitset
@@ -52,9 +52,10 @@
 # include <string>
 # include <iosfwd>
 # include <bits/cxxabi_forced.h>
-# if __cplusplus >= 201103L
-#  include <bits/functional_hash.h>
-# endif
+#endif
+
+#if __cplusplus >= 201103L
+# include <bits/functional_hash.h>
 #endif
 
 #define _GLIBCXX_BITSET_BITS_PER_WORD  (__CHAR_BIT__ * __SIZEOF_LONG__)
@@ -1664,7 +1665,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
 #undef _GLIBCXX_BITSET_BITS_PER_WORD
 #undef _GLIBCXX_BITSET_BITS_PER_ULL
 
-#if __cplusplus >= 201103L && _GLIBCXX_HOSTED
+#if __cplusplus >= 201103L
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
diff --git a/libstdc++-v3/testsuite/20_util/bitset/cons/constexpr_c++23.cc b/libstdc++-v3/testsuite/20_util/bitset/cons/constexpr_c++23.cc
index 532fc9dc4d5..d308c2b2f10 100644
--- a/libstdc++-v3/testsuite/20_util/bitset/cons/constexpr_c++23.cc
+++ b/libstdc++-v3/testsuite/20_util/bitset/cons/constexpr_c++23.cc
@@ -1,5 +1,7 @@
 // { dg-options "-std=gnu++23" }
 // { dg-do compile { target c++23 } }
+// This test relies on std::string.
+// { dg-require-effective-target hosted }
 
 #include <bitset>
 
diff --git a/libstdc++-v3/testsuite/20_util/bitset/ext/constexpr.cc b/libstdc++-v3/testsuite/20_util/bitset/ext/constexpr.cc
index f82e7aa409a..4bacefad14a 100644
--- a/libstdc++-v3/testsuite/20_util/bitset/ext/constexpr.cc
+++ b/libstdc++-v3/testsuite/20_util/bitset/ext/constexpr.cc
@@ -1,5 +1,7 @@
 // { dg-options "-std=gnu++23" }
 // { dg-do compile { target c++23 } }
+// This test relies on std::string.
+// { dg-require-effective-target hosted }
 
 #include <bitset>
 #include <testsuite_hooks.h>

                 reply	other threads:[~2022-10-03 14:46 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=20221003144607.5C02B3857C61@sourceware.org \
    --to=redi@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: 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).