From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 5C02B3857C61; Mon, 3 Oct 2022 14:46:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C02B3857C61 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664808367; bh=QUnZ01WxmDkkIF1nS+lZKQy3i8vh+2x0Dtzo4GoSkRM=; h=From:To:Subject:Date:From; b=N2Yw+1FhN/nF2mNI/UWBy7D9mVVrs/qVPtax0jUN4uUHDVaMgH8mjj49/FAkd6N6V 5DcwBINkxCsczbN/ITPAzJOZegQwZYnqsyq/e/uhm4mSVjEPxwbxAnJ9fPDz7YzfRc xPkvSucNepLOqD405X79S5q/3h0x6f9L5FNygNzw= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-3041] libstdc++: Re-enable std::hash in freestanding [PR103626] X-Act-Checkin: gcc X-Git-Author: =?utf-8?q?Arsen_Arsenovi=C4=87?= X-Git-Refname: refs/heads/master X-Git-Oldrev: 25ebfdb774c0e8cc6c55e02644ee2cb157ce29d7 X-Git-Newrev: 54fd7d81709c5f50537128d3978b4c642b68a711 Message-Id: <20221003144607.5C02B3857C61@sourceware.org> Date: Mon, 3 Oct 2022 14:46:07 +0000 (GMT) List-Id: https://gcc.gnu.org/g:54fd7d81709c5f50537128d3978b4c642b68a711 commit r13-3041-g54fd7d81709c5f50537128d3978b4c642b68a711 Author: Arsen Arsenović Date: Wed Sep 28 21:30:11 2022 +0200 libstdc++: Re-enable std::hash 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 # include # include -# if __cplusplus >= 201103L -# include -# endif +#endif + +#if __cplusplus >= 201103L +# include #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 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 #include