Skip to content

Commit 3e8a4bf

Browse files
[lldb][test] Synchronize __compressed_pair_padding with libc++
1 parent 6f64a60 commit 3e8a4bf

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

lldb/packages/Python/lldbsuite/test/make/libcxx-simulators-common/compressed_pair.h

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,24 @@ inline const size_t __datasizeof_v =
7272
template <class _Tp>
7373
struct __lldb_is_final : public integral_constant<bool, __is_final(_Tp)> {};
7474

75-
template <class _ToPad> class __compressed_pair_padding {
76-
char __padding_[((is_empty<_ToPad>::value &&
77-
!__lldb_is_final<_ToPad>::value) ||
78-
is_reference<_ToPad>::value)
79-
? 0
80-
: sizeof(_ToPad) - __datasizeof_v<_ToPad>];
75+
template <class _ToPad>
76+
inline const bool __is_reference_or_unpadded_object =
77+
(std::is_empty<_ToPad>::value && !__lldb_is_final<_ToPad>::value) ||
78+
sizeof(_ToPad) == __datasizeof_v<_ToPad>;
79+
80+
template <class _Tp>
81+
inline const bool __is_reference_or_unpadded_object<_Tp &> = true;
82+
83+
template <class _Tp>
84+
inline const bool __is_reference_or_unpadded_object<_Tp &&> = true;
85+
86+
template <class _ToPad, bool _Empty = __is_reference_or_unpadded_object<_ToPad>>
87+
class __compressed_pair_padding {
88+
char __padding_[sizeof(_ToPad) - __datasizeof_v<_ToPad>] = {};
8189
};
8290

91+
template <class _ToPad> class __compressed_pair_padding<_ToPad, true> {};
92+
8393
#define _LLDB_COMPRESSED_PAIR(T1, Initializer1, T2, Initializer2) \
8494
[[__gnu__::__aligned__( \
8595
alignof(T2))]] _LLDB_NO_UNIQUE_ADDRESS T1 Initializer1; \

0 commit comments

Comments
 (0)