]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Use reserved name for attribute [PR101055]
authorJonathan Wakely <jwakely@redhat.com>
Mon, 14 Jun 2021 09:58:15 +0000 (10:58 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 14 Jun 2021 10:53:29 +0000 (11:53 +0100)
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.

libstdc++-v3/include/std/tuple
libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc
libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc
libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc

index 3b771c50b255c226cd508c01f9cb0efd3d55d8c7..2d562f8da774b580cd92c52a24c2361c172141e8 100644 (file)
@@ -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<size_t _Idx, typename _Head>
     struct _Head_base<_Idx, _Head, true>
     {
index c5c94ad7702c340a82815d22b7c2184d588b127d..c38fc7d4d84a91fcee95ae1e080438a47b368c06 100644 (file)
@@ -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.
index c8f036219ff4c520bb356b3e0fd20299e367b9bc..65d273db19c5bc2236bead5cd2f72ddca069a51c 100644 (file)
@@ -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.
index c4e38d6423a1aa1b5b730a3d3ced14eafea8fb6e..811b3fe3613a964c3308130ef2869c433400b263 100644 (file)
@@ -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.