From: Jonathan Wakely Date: Thu, 23 May 2019 15:08:52 +0000 (+0100) Subject: Fix missing or incorrect feature test macros X-Git-Tag: releases/gcc-7.5.0~428 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b39855ba1e4f45741437e3175ec30b480ccc560;p=thirdparty%2Fgcc.git Fix missing or incorrect feature test macros Backported from mainline 2019-01-15 Jonathan Wakely * 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. From-SVN: r271564 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 028ab8defd53..f8480a46dbb0 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,17 @@ +2019-05-23 Jonathan Wakely + + Backported from mainline + 2019-01-15 Jonathan Wakely + + * 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. + 2019-05-08 Jonathan Wakely Backport from mainline diff --git a/libstdc++-v3/doc/html/manual/status.html b/libstdc++-v3/doc/html/manual/status.html index 014760a2f64f..4da9f0ad4b3d 100644 --- a/libstdc++-v3/doc/html/manual/status.html +++ b/libstdc++-v3/doc/html/manual/status.html @@ -657,7 +657,7 @@ Feature-testing recommendations for C++. P0040R3 - 7.1 shared_ptr::weak_type + 7.1 __cpp_lib_raw_memory_algorithms >= 201606L shared_ptr::weak_type P0163R0 @@ -811,7 +811,19 @@ Feature-testing recommendations for C++. P0067R5 8 (only integral types supported) __has_include(<charconv>) - __cpp_lib_to_chars >= 201611

+ __cpp_lib_to_chars >= 201611 Homogeneous interface for variant, any and optional + + P0032R3 + + 7.1 + __cpp_lib_any >= 201606 , + __cpp_lib_optional >= 201606 , + __cpp_lib_variant >= 201606 + Making Optional Greater Equal Again + + P0307R2 + + 7.1 __cpp_lib_optional >= 201606

Note 1: This feature is supported in GCC 7.1 and 7.2 but before GCC 7.3 the __cpp_lib macro is not defined, and compilation will fail if the header is included without using -std to enable C++17 support. diff --git a/libstdc++-v3/doc/xml/manual/status_cxx2017.xml b/libstdc++-v3/doc/xml/manual/status_cxx2017.xml index 168933808ebe..8ca061177424 100644 --- a/libstdc++-v3/doc/xml/manual/status_cxx2017.xml +++ b/libstdc++-v3/doc/xml/manual/status_cxx2017.xml @@ -381,7 +381,7 @@ Feature-testing recommendations for C++. 7.1 - + __cpp_lib_raw_memory_algorithms >= 201606L @@ -789,6 +789,31 @@ Feature-testing recommendations for C++. __cpp_lib_to_chars >= 201611 + + Homogeneous interface for variant, any and optional + + + P0032R3 + + + 7.1 + + __cpp_lib_any >= 201606 , + __cpp_lib_optional >= 201606 , + __cpp_lib_variant >= 201606 + + + + + Making Optional Greater Equal Again + + + P0307R2 + + + 7.1 + __cpp_lib_optional >= 201606 + diff --git a/libstdc++-v3/include/bits/stl_uninitialized.h b/libstdc++-v3/include/bits/stl_uninitialized.h index c2ba863ed984..89e311b2cb2e 100644 --- a/libstdc++-v3/include/bits/stl_uninitialized.h +++ b/libstdc++-v3/include/bits/stl_uninitialized.h @@ -827,6 +827,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif #if __cplusplus > 201402L +# define __cpp_lib_raw_memory_algorithms 201606L + template inline void uninitialized_default_construct(_ForwardIterator __first, diff --git a/libstdc++-v3/include/std/any b/libstdc++-v3/include/std/any index 50daa80fcf9e..b0047180fb5d 100644 --- a/libstdc++-v3/include/std/any +++ b/libstdc++-v3/include/std/any @@ -66,7 +66,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif } -#define __cpp_lib_any 201603 +#define __cpp_lib_any 201606L /** * @brief A type-safe container of any type. diff --git a/libstdc++-v3/include/std/optional b/libstdc++-v3/include/std/optional index 49ed8632227f..ba5a478df7e7 100644 --- a/libstdc++-v3/include/std/optional +++ b/libstdc++-v3/include/std/optional @@ -51,7 +51,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @{ */ -#define __cpp_lib_optional 201603 +#define __cpp_lib_optional 201606L template class optional; diff --git a/libstdc++-v3/include/std/variant b/libstdc++-v3/include/std/variant index 2efe62cfe7ca..79c84e1f6a8f 100644 --- a/libstdc++-v3/include/std/variant +++ b/libstdc++-v3/include/std/variant @@ -71,7 +71,7 @@ _GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION -#define __cpp_lib_variant 201603 +#define __cpp_lib_variant 201606L template class tuple; template class variant;