From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id A75E9385782B; Mon, 14 Jun 2021 10:53:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A75E9385782B 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 r12-1420] libstdc++: Use reserved name for attribute [PR101055] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 08ce1f4c5091b80b680d15c53a17237544a3cca8 X-Git-Newrev: 917efba2dd4ff34336d0d3aa55285ae22503e4aa Message-Id: <20210614105344.A75E9385782B@sourceware.org> Date: Mon, 14 Jun 2021 10:53:44 +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: Mon, 14 Jun 2021 10:53:44 -0000 https://gcc.gnu.org/g:917efba2dd4ff34336d0d3aa55285ae22503e4aa commit r12-1420-g917efba2dd4ff34336d0d3aa55285ae22503e4aa Author: Jonathan Wakely Date: Mon Jun 14 10:58:15 2021 +0100 libstdc++: Use reserved name for attribute [PR101055] The no_unique_address attribute is not a reserved name until C++20, so to use it in C++11/14/17 modes we should use the __no_unique_address_ form. We already use that form when using the attribute, but not in the __has_cpp_attribute check. libstdc++-v3/ChangeLog: PR libstdc++/101055 * include/std/tuple: Use reserved form of attribute name. * testsuite/17_intro/headers/c++2011/all_attributes.cc: Add check for no_unique_address. * testsuite/17_intro/headers/c++2014/all_attributes.cc: Likewise. * testsuite/17_intro/headers/c++2017/all_attributes.cc: Likewise. Diff: --- libstdc++-v3/include/std/tuple | 2 +- libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc | 1 + libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc | 1 + libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index 3b771c50b25..2d562f8da77 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -73,7 +73,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION bool = __empty_not_final<_Head>::value> struct _Head_base; -#if __has_cpp_attribute(no_unique_address) +#if __has_cpp_attribute(__no_unique_address__) template struct _Head_base<_Idx, _Head, true> { diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc index c5c94ad7702..c38fc7d4d84 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc @@ -28,6 +28,7 @@ # define deprecated 1 # define visibility 1 #endif +#define no_unique_address 1 #define packed 1 #define pure 1 // glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM. diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc index c8f036219ff..65d273db19c 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc @@ -28,6 +28,7 @@ # define deprecated 1 # define visibility 1 #endif +#define no_unique_address 1 #define packed 1 #define pure 1 // glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM. diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc index c4e38d6423a..811b3fe3613 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc @@ -26,6 +26,7 @@ # define cold 1 # define visibility 1 #endif +#define no_unique_address 1 #define packed 1 #define pure 1 // glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM.