diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -394,8 +394,6 @@ # error "We don't know a correct way to implement alignof(T) in C++03 outside of Clang" #endif -#define _LIBCPP_PREFERRED_ALIGNOF(_Tp) __alignof(_Tp) - #if defined(_LIBCPP_COMPILER_CLANG_BASED) #if defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && \ diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -747,7 +747,8 @@ template struct __align_type { - static const size_t value = _LIBCPP_PREFERRED_ALIGNOF(_Tp); + // We want the preferred alignof instead of the minimum, so use __alignof instead + static const size_t value = __alignof(_Tp); typedef _Tp type; }; @@ -881,8 +882,9 @@ template struct aligned_union { - static const size_t alignment_value = __static_max<_LIBCPP_PREFERRED_ALIGNOF(_Type0), - _LIBCPP_PREFERRED_ALIGNOF(_Types)...>::value; + // We want the preferred alignof instead of the minimum, so use __alignof instead + static const size_t alignment_value = __static_max<__alignof(_Type0), + __alignof(_Types)...>::value; static const size_t __len = __static_max<_Len, sizeof(_Type0), sizeof(_Types)...>::value; typedef typename aligned_storage<__len, alignment_value>::type type;