diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -394,8 +394,7 @@ # ifndef _LIBCPP_CXX03_LANG # define _LIBCPP_ALIGNOF(_Tp) alignof(_Tp) -# define _ALIGNAS_TYPE(x) alignas(x) -# define _ALIGNAS(x) alignas(x) +# define _ALIGNAS(...) alignas(__VA_ARGS__) # define _LIBCPP_NORETURN [[noreturn]] # define _NOEXCEPT noexcept # define _NOEXCEPT_(x) noexcept(x) @@ -403,8 +402,7 @@ # else # define _LIBCPP_ALIGNOF(_Tp) _Alignof(_Tp) -# define _ALIGNAS_TYPE(x) __attribute__((__aligned__(_LIBCPP_ALIGNOF(x)))) -# define _ALIGNAS(x) __attribute__((__aligned__(x))) +# define _ALIGNAS(...) _Alignas(__VA_ARGS__) # define _LIBCPP_NORETURN __attribute__((noreturn)) # define _LIBCPP_HAS_NO_NOEXCEPT # define nullptr __nullptr diff --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h --- a/libcxx/include/__memory/shared_ptr.h +++ b/libcxx/include/__memory/shared_ptr.h @@ -330,7 +330,7 @@ // we now use a properly aligned char buffer while making sure that we maintain // the same layout that we had when we used a compressed pair. using _CompressedPair = __compressed_pair<_Alloc, _Tp>; - struct _ALIGNAS_TYPE(_CompressedPair) _Storage { + struct _ALIGNAS(_CompressedPair) _Storage { char __blob_[sizeof(_CompressedPair)]; _LIBCPP_HIDE_FROM_ABI explicit _Storage(_Alloc&& __a) { diff --git a/libcxx/include/array b/libcxx/include/array --- a/libcxx/include/array +++ b/libcxx/include/array @@ -272,7 +272,7 @@ char>::type _CharType; struct _ArrayInStructT { _Tp __data_[1]; }; - _ALIGNAS_TYPE(_ArrayInStructT) _CharType __elems_[sizeof(_ArrayInStructT)]; + _ALIGNAS(_ArrayInStructT) _CharType __elems_[sizeof(_ArrayInStructT)]; _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 value_type* data() _NOEXCEPT {return nullptr;} diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h --- a/libcxx/test/support/test_macros.h +++ b/libcxx/test/support/test_macros.h @@ -127,7 +127,7 @@ # else # define TEST_ALIGNOF(...) __alignof(__VA_ARGS__) # endif -# define TEST_ALIGNAS(...) __attribute__((__aligned__(__VA_ARGS__))) +# define TEST_ALIGNAS(...) _Alignas(__VA_ARGS__) # define TEST_CONSTEXPR # define TEST_NOEXCEPT throw() # define TEST_NOEXCEPT_FALSE