Commit 2025db69 by Jonathan Wakely

libstdc++: Do not define __cpp_lib_constexpr_algorithms in <utility>

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>.
parent c9313582
2020-04-22 Jonathan Wakely <jwakely@redhat.com> 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 * include/std/functional (__cpp_lib_concepts): Update macro value to
indicate P1964R2 support. indicate P1964R2 support.
* include/std/version (__cpp_lib_concepts): Likewise. * include/std/version (__cpp_lib_concepts): Likewise.
......
...@@ -238,7 +238,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -238,7 +238,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
get(const std::pair<_Tp1, _Tp2>&& __in) noexcept get(const std::pair<_Tp1, _Tp2>&& __in) noexcept
{ return __pair_get<_Int>::__const_move_get(std::move(__in)); } { return __pair_get<_Int>::__const_move_get(std::move(__in)); }
#if __cplusplus > 201103L #if __cplusplus >= 201402L
#define __cpp_lib_tuples_by_type 201304 #define __cpp_lib_tuples_by_type 201304
...@@ -284,10 +284,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -284,10 +284,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#define __cpp_lib_exchange_function 201304 #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. /// Assign @p __new_val to @p __obj and return its previous value.
template <typename _Tp, typename _Up = _Tp> template <typename _Tp, typename _Up = _Tp>
_GLIBCXX20_CONSTEXPR _GLIBCXX20_CONSTEXPR
...@@ -295,7 +291,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -295,7 +291,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
exchange(_Tp& __obj, _Up&& __new_val) exchange(_Tp& __obj, _Up&& __new_val)
{ return std::__exchange(__obj, std::forward<_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 // Stores a tuple of indices. Used by tuple and pair, and by bind() to
// extract the elements in a tuple. // extract the elements in a tuple.
......
...@@ -20,12 +20,6 @@ ...@@ -20,12 +20,6 @@
#include <utility> #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 constexpr bool
test() test()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment