This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Fix missing or incorrect feature test macros
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 15 Jan 2019 12:59:18 +0000
- Subject: Re: [PATCH] Fix missing or incorrect feature test macros
- References: <20190115120111.GA16586@redhat.com>
On 15/01/19 12:01 +0000, Jonathan Wakely wrote:
* doc/xml/manual/status_cxx2017.xml: Document P0032R3 and P0307R2
status.
* include/bits/stl_uninitialized.h (__cpp_lib_raw_memory_algorithms):
Define.
* include/std/any (__cpp_lib_any): Define as 201606L, because P0032R3
changes are supported.
* include/std/optional (__cpp_lib_optional): Likewise.
* include/std/variant (__cpp_lib_variant): Likewise.
* include/std/version [!__STRICT_ANSI__]
(__cpp_lib_uncaught_exceptions): Define as long integer.
[__cplusplus >= 201703L] (__cpp_lib_any)
(__cpp_lib_raw_memory_algorithms, __cpp_lib_uncaught_exceptions)
(__cpp_lib_variant): Define for C++17.
[__cplusplus >= 201703L] (__cpp_lib_optional): Update value and define
as long integer.
* libsupc++/exception (__cpp_lib_uncaught_exceptions): Define as long
integer.
Some more found by Jakub. Everything in <version> should be consistent
with the rest of the library headers now, for all -std modes.
Tested powerpc64le-linux, committed to trunk.
commit 40a9d96b4b6ce6d4366a9e3f0cc9f8b8bfb054a5
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Tue Jan 15 12:39:18 2019 +0000
Fix more missing or incorrect feature test macros
* include/bits/erase_if.h [__cplusplus > 201703L]
(__cpp_lib_erase_if): Only define for C++2a.
* include/std/iterator [__cplusplus >= 201402L && !_GLIBCXX_DEBUG]
(__cpp_lib_null_iterators): Define.
* include/std/version [__cplusplus >= 201402L && !_GLIBCXX_DEBUG]
(__cpp_lib_null_iterators): Define.
[__cpp_impl_destroying_delete] (__cpp_lib_destroying_delete): Define.
diff --git a/libstdc++-v3/include/bits/erase_if.h b/libstdc++-v3/include/bits/erase_if.h
index d84f5ffc8ed..4641dbebd85 100644
--- a/libstdc++-v3/include/bits/erase_if.h
+++ b/libstdc++-v3/include/bits/erase_if.h
@@ -38,7 +38,9 @@ namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#define __cpp_lib_erase_if 201900L
+#if __cplusplus > 201703L
+# define __cpp_lib_erase_if 201900L
+#endif
namespace __detail
{
diff --git a/libstdc++-v3/include/std/iterator b/libstdc++-v3/include/std/iterator
index 5c6903c1cff..9d9e19c4c6b 100644
--- a/libstdc++-v3/include/std/iterator
+++ b/libstdc++-v3/include/std/iterator
@@ -67,4 +67,8 @@
#include <bits/streambuf_iterator.h>
#include <bits/range_access.h>
+#if __cplusplus >= 201402L && ! defined _GLIBCXX_DEBUG // PR libstdc++/70303
+# define __cpp_lib_null_iterators 201304L
+#endif
+
#endif /* _GLIBCXX_ITERATOR */
diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version
index f49a45940f9..36d291dcf93 100644
--- a/libstdc++-v3/include/std/version
+++ b/libstdc++-v3/include/std/version
@@ -42,6 +42,10 @@
# define __cpp_lib_uncaught_exceptions 201411L
#endif
+#if __cpp_impl_destroying_delete
+# define __cpp_lib_destroying_delete 201806L
+#endif
+
#if __cplusplus >= 201103L
// c++11
#define __cpp_lib_allocator_is_always_equal 201411
@@ -71,6 +75,9 @@
#define __cpp_lib_is_final 201402L
#define __cpp_lib_make_reverse_iterator 201402
#define __cpp_lib_make_unique 201304
+#ifndef _GLIBCXX_DEBUG // PR libstdc++/70303
+# define __cpp_lib_null_iterators 201304L
+#endif
#define __cpp_lib_quoted_string_io 201304
#define __cpp_lib_robust_nonmodifying_seq_ops 201304
#ifdef _GLIBCXX_HAS_GTHREADS