From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 29988386FC30; Fri, 30 Apr 2021 22:02:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 29988386FC30 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 r8-10935] libstdc++: Fix inconsistent feature test macro X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-8 X-Git-Oldrev: e22ffa06aa2a996e5967c831d319894be4fdaffa X-Git-Newrev: d3879001ee42af0f09b5f3b54d8b3d90398532d4 Message-Id: <20210430220235.29988386FC30@sourceware.org> Date: Fri, 30 Apr 2021 22:02:35 +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 22:02:35 -0000 https://gcc.gnu.org/g:d3879001ee42af0f09b5f3b54d8b3d90398532d4 commit r8-10935-gd3879001ee42af0f09b5f3b54d8b3d90398532d4 Author: Jonathan Wakely Date: Fri Apr 30 20:32:05 2021 +0100 libstdc++: Fix inconsistent feature test macro The __cpp_lib_constexpr_string feature test macro is not defined consistently in and . libstdc++-v3/ChangeLog: * include/bits/basic_string.h (__cpp_lib_constexpr_string): Only define for C++17 and later. (cherry picked from commit 3215d4f5b3d08e0087a88df9e155c779927ace1a) Diff: --- libstdc++-v3/include/bits/basic_string.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index 0be11c0c444..5eede562884 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -52,7 +52,10 @@ namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION -#define __cpp_lib_constexpr_string 201611L +#if __cplusplus >= 201703L +// Support P0426R1 changes to char_traits in C++17. +# define __cpp_lib_constexpr_string 201611L +#endif #if _GLIBCXX_USE_CXX11_ABI _GLIBCXX_BEGIN_NAMESPACE_CXX11