]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Re-enable std::hash<std::bitset> in freestanding [PR103626]
authorArsen Arsenović <arsen@aarsen.me>
Wed, 28 Sep 2022 19:30:11 +0000 (21:30 +0200)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 3 Oct 2022 14:43:49 +0000 (15:43 +0100)
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.

libstdc++-v3/include/std/bitset
libstdc++-v3/testsuite/20_util/bitset/cons/constexpr_c++23.cc
libstdc++-v3/testsuite/20_util/bitset/ext/constexpr.cc

index 1038cc65138ccf3c1e46802dc94348b5341f41f7..10fb05a1b9027e49e0d925f2ca4623bad836768c 100644 (file)
 # 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)
 {
index 532fc9dc4d578ac27395cdc28e5aed98cd99c015..d308c2b2f10d08eaa151fd48a208c572dcd09db8 100644 (file)
@@ -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>
 
index f82e7aa409a17ac5c4e026bceecacad306fc905a..4bacefad14ad7f6d7688700b55053adfe06684eb 100644 (file)
@@ -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>