[Lldb-commits] [lldb] [lldb][test] Synchronize `__compressed_pair_padding` with libc++ (PR #142516)
A. Jiang via lldb-commits
lldb-commits at lists.llvm.org
Wed Jun 18 09:56:19 PDT 2025
================
@@ -72,14 +72,24 @@ inline const size_t __datasizeof_v =
template <class _Tp>
struct __lldb_is_final : public integral_constant<bool, __is_final(_Tp)> {};
-template <class _ToPad> class __compressed_pair_padding {
- char __padding_[((is_empty<_ToPad>::value &&
- !__lldb_is_final<_ToPad>::value) ||
- is_reference<_ToPad>::value)
- ? 0
- : sizeof(_ToPad) - __datasizeof_v<_ToPad>];
+template <class _ToPad>
+inline const bool __is_reference_or_unpadded_object =
+ (std::is_empty<_ToPad>::value && !__lldb_is_final<_ToPad>::value) ||
+ sizeof(_ToPad) == __datasizeof_v<_ToPad>;
+
+template <class _Tp>
+inline const bool __is_reference_or_unpadded_object<_Tp &> = true;
+
+template <class _Tp>
+inline const bool __is_reference_or_unpadded_object<_Tp &&> = true;
+
+template <class _ToPad, bool _Empty = __is_reference_or_unpadded_object<_ToPad>>
+class __compressed_pair_padding {
+ char __padding_[sizeof(_ToPad) - __datasizeof_v<_ToPad>] = {};
};
+template <class _ToPad> class __compressed_pair_padding<_ToPad, true> {};
----------------
frederick-vs-ja wrote:
Sorry for late replying. I'll do this soon, although this seems unnecessary as there doesn't seem any case where the layout will change.
https://github.com/llvm/llvm-project/pull/142516
More information about the lldb-commits
mailing list