From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 7D98D3847839; Fri, 30 Apr 2021 21:13:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D98D3847839 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-8338] libstdc++: Fix inconsistent feature test macros X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 7f37c47c1eb4d84badba67bc81a6879f6676faf1 X-Git-Newrev: 0081f6165bc00ed52514016b50b02e54b5cac41b Message-Id: <20210430211319.7D98D3847839@sourceware.org> Date: Fri, 30 Apr 2021 21:13:19 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 21:13:19 -0000 https://gcc.gnu.org/g:0081f6165bc00ed52514016b50b02e54b5cac41b commit r11-8338-g0081f6165bc00ed52514016b50b02e54b5cac41b Author: Jonathan Wakely Date: Fri Apr 30 20:32:05 2021 +0100 libstdc++: Fix inconsistent feature test macros The __cpp_lib_constexpr_string and __cpp_lib_semaphore feature test macros are not defined consistently in and the relevant header for the feature. libstdc++-v3/ChangeLog: * include/bits/basic_string.h (__cpp_lib_constexpr_string): Only define for C++17 and later. * include/std/version (__cpp_lib_semaphore): Fix condition to match the one in . (cherry picked from commit 3215d4f5b3d08e0087a88df9e155c779927ace1a) Diff: --- libstdc++-v3/include/bits/basic_string.h | 2 +- libstdc++-v3/include/std/version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index 41d781c698e..fba7c6f3354 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -55,7 +55,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #if __cplusplus == 201703L // Support P0426R1 changes to char_traits in C++17. # define __cpp_lib_constexpr_string 201611L -#else +#elif __cplusplus > 201703L // Also support P1032R1 in C++20 (but not P0980R1 yet). # define __cpp_lib_constexpr_string 201811L #endif diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version index 09e67a40d0c..ea0e18a3f9d 100644 --- a/libstdc++-v3/include/std/version +++ b/libstdc++-v3/include/std/version @@ -241,7 +241,7 @@ #if __cpp_lib_concepts # define __cpp_lib_ranges 201911L #endif -#if __cpp_lib_atomic_wait +#if __cpp_lib_atomic_wait || _GLIBCXX_HAVE_POSIX_SEMAPHORE # define __cpp_lib_semaphore 201907L #endif #define __cpp_lib_shift 201806L