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.
This commit is contained in:
Jonathan Wakely 2021-06-14 10:58:15 +01:00
parent 08ce1f4c50
commit 917efba2dd
4 changed files with 4 additions and 1 deletions

View 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>
{

View 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.

View 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.

View 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.