@@ -52,15 +52,16 @@ _LIBCPP_BEGIN_NAMESPACE_STD
5252// member3 - offset: 8, size: 8
5353//
5454// Furthermore, that alignment must be the same as what was used in the old __compressed_pair layout, so we must
55- // handle reference types specially since alignof(T&) == alignof(T). See https://github.com/llvm/llvm-project/issues/118559.
55+ // handle reference types specially since alignof(T&) == alignof(T).
56+ // See https://github.com/llvm/llvm-project/issues/118559.
5657
5758#ifndef _LIBCPP_ABI_NO_COMPRESSED_PAIR_PADDING
5859
5960template <class _Tp >
60- struct __compressed_pair_alignment : integral_constant< size_t , _LIBCPP_ALIGNOF(_Tp)> {} ;
61+ inline const size_t __compressed_pair_alignment = _LIBCPP_ALIGNOF(_Tp);
6162
6263template <class _Tp >
63- struct __compressed_pair_alignment <_Tp&> : integral_constant< size_t , _LIBCPP_ALIGNOF(void *)> {} ;
64+ inline const size_t __compressed_pair_alignment<_Tp&> = _LIBCPP_ALIGNOF(void *);
6465
6566template <class _ToPad ,
6667 bool _Empty = ((is_empty<_ToPad>::value && !__libcpp_is_final<_ToPad>::value) ||
@@ -73,16 +74,15 @@ template <class _ToPad>
7374class __compressed_pair_padding <_ToPad, true > {};
7475
7576# define _LIBCPP_COMPRESSED_PAIR (T1, Initializer1, T2, Initializer2 ) \
76- _LIBCPP_NO_UNIQUE_ADDRESS \
77- __attribute__ ((__aligned__(::std::__compressed_pair_alignment<T2>::value))) T1 Initializer1; \
77+ _LIBCPP_NO_UNIQUE_ADDRESS __attribute__ ((__aligned__(::std::__compressed_pair_alignment<T2>))) T1 Initializer1; \
7878 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T1> _LIBCPP_CONCAT3 (__padding1_, __LINE__, _); \
7979 _LIBCPP_NO_UNIQUE_ADDRESS T2 Initializer2; \
8080 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T2> _LIBCPP_CONCAT3 (__padding2_, __LINE__, _)
8181
8282# define _LIBCPP_COMPRESSED_TRIPLE (T1, Initializer1, T2, Initializer2, T3, Initializer3 ) \
8383 _LIBCPP_NO_UNIQUE_ADDRESS \
84- __attribute__ ((__aligned__(::std::__compressed_pair_alignment<T2>::value), \
85- __aligned__(::std::__compressed_pair_alignment<T3>::value ))) T1 Initializer1; \
84+ __attribute__ ((__aligned__(::std::__compressed_pair_alignment<T2>), \
85+ __aligned__(::std::__compressed_pair_alignment<T3>))) T1 Initializer1; \
8686 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T1> _LIBCPP_CONCAT3 (__padding1_, __LINE__, _); \
8787 _LIBCPP_NO_UNIQUE_ADDRESS T2 Initializer2; \
8888 _LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T2> _LIBCPP_CONCAT3 (__padding2_, __LINE__, _); \
0 commit comments