From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [committed 6/8] libstdc++: Do not define __cpp_lib_constexpr_algorithms in <utility>
Date: Wed, 22 Apr 2020 22:59:09 +0100 [thread overview]
Message-ID: <2025db692e9ed1192f831bc122413a226987515c.1587592482.git.jwakely@redhat.com> (raw)
In-Reply-To: <cover.1587592482.git.jwakely@redhat.com>
The C++20 draft and SD-6 both say this should only be in <version> and
<algorithm>, not in <utility>.
* include/std/utility (__cpp_lib_constexpr_algorithms): Do not define
here.
* testsuite/20_util/exchange/constexpr.cc: Do not expect macro to be
defined by <utility>.
---
libstdc++-v3/ChangeLog | 5 +++++
libstdc++-v3/include/std/utility | 8 ++------
libstdc++-v3/testsuite/20_util/exchange/constexpr.cc | 6 ------
3 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 4e86ec188a5..4fec7b21029 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,10 @@
2020-04-22 Jonathan Wakely <jwakely@redhat.com>
+ * include/std/utility (__cpp_lib_constexpr_algorithms): Do not define
+ here.
+ * testsuite/20_util/exchange/constexpr.cc: Do not expect macro to be
+ defined by <utility>.
+
* include/std/functional (__cpp_lib_concepts): Update macro value to
indicate P1964R2 support.
* include/std/version (__cpp_lib_concepts): Likewise.
diff --git a/libstdc++-v3/include/std/utility b/libstdc++-v3/include/std/utility
index dc6e8468af5..5f1675a7679 100644
--- a/libstdc++-v3/include/std/utility
+++ b/libstdc++-v3/include/std/utility
@@ -238,7 +238,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
get(const std::pair<_Tp1, _Tp2>&& __in) noexcept
{ return __pair_get<_Int>::__const_move_get(std::move(__in)); }
-#if __cplusplus > 201103L
+#if __cplusplus >= 201402L
#define __cpp_lib_tuples_by_type 201304
@@ -284,10 +284,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#define __cpp_lib_exchange_function 201304
-#if __cplusplus > 201703L
-# define __cpp_lib_constexpr_algorithms 201806L
-#endif
-
/// Assign @p __new_val to @p __obj and return its previous value.
template <typename _Tp, typename _Up = _Tp>
_GLIBCXX20_CONSTEXPR
@@ -295,7 +291,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
exchange(_Tp& __obj, _Up&& __new_val)
{ return std::__exchange(__obj, std::forward<_Up>(__new_val)); }
-#endif
+#endif // C++14
// Stores a tuple of indices. Used by tuple and pair, and by bind() to
// extract the elements in a tuple.
diff --git a/libstdc++-v3/testsuite/20_util/exchange/constexpr.cc b/libstdc++-v3/testsuite/20_util/exchange/constexpr.cc
index 3673772ea4b..ee6cbaebdee 100644
--- a/libstdc++-v3/testsuite/20_util/exchange/constexpr.cc
+++ b/libstdc++-v3/testsuite/20_util/exchange/constexpr.cc
@@ -20,12 +20,6 @@
#include <utility>
-#ifndef __cpp_lib_constexpr_algorithms
-# error "Feature-test macro for constexpr algorithms missing"
-#elif __cpp_lib_constexpr_algorithms < 201806L
-# error "Feature-test macro for constexpr algorithms has wrong value"
-#endif
-
constexpr bool
test()
{
--
2.25.3
next prev parent reply other threads:[~2020-04-22 21:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-22 21:57 [committed 0/8] libstdc++: Add/update/fix feature test macros Jonathan Wakely
2020-04-22 21:58 ` [committed 1/8] libstdc++: Update value of __cpp_lib_jthread macro Jonathan Wakely
2020-04-22 21:58 ` [committed 2/8] libstdc++: Remove non-standard feature test macros Jonathan Wakely
2020-04-22 21:58 ` [committed 3/8] libstdc++: Add missing " Jonathan Wakely
2020-04-22 21:58 ` [committed 4/8] libstdc++: Rename __cpp_lib_constexpr_invoke macro Jonathan Wakely
2020-04-22 21:59 ` [committed 5/8] libstdc++: Update __cpp_lib_concepts value Jonathan Wakely
2020-04-22 21:59 ` Jonathan Wakely [this message]
2020-04-22 21:59 ` [committed 7/8] libstdc++: Update (and revert) value of __cpp_lib_array_constexpr Jonathan Wakely
2020-04-23 20:44 ` Jonathan Wakely
2020-04-22 21:59 ` [committed 8/8] libstdc++: Define __cpp_lib_execution feature test macro Jonathan Wakely
2020-04-23 20:41 ` [committed 9/8] libstdc++: Define __cpp_lib_three_way_comparison for freestanding Jonathan Wakely
2020-04-23 20:46 ` [committed 0/8] libstdc++: Add/update/fix feature test macros Jonathan Wakely
2020-04-28 22:52 ` [committed 10/8] libstdc++: Fixes for feature test macros (PR 91480) Jonathan Wakely
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=2025db692e9ed1192f831bc122413a226987515c.1587592482.git.jwakely@redhat.com \
--to=jwakely@redhat.com \
--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).