From 1996194fc6c2b5ccf5445468d5714b596b81f077 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 12 Jul 2024 08:42:43 +0100 Subject: [PATCH] fixup! use the common compressed_pair implementation for string simulator --- .../libcxx/string/simulator/main.cpp | 35 ++----------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/simulator/main.cpp b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/simulator/main.cpp index 33e71044482a75..7beeb9c39de49e 100644 --- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/simulator/main.cpp +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/simulator/main.cpp @@ -1,3 +1,5 @@ +#include + #include #include #include @@ -32,37 +34,6 @@ namespace std { namespace __lldb { -template ::value && !std::is_final<_Tp>::value> -struct __compressed_pair_elem { - explicit __compressed_pair_elem(_Tp __t) : __value_(__t) {} - - _Tp &__get() { return __value_; } - -private: - _Tp __value_; -}; - -template -struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp { - explicit __compressed_pair_elem(_Tp __t) : _Tp(__t) {} - - _Tp &__get() { return *this; } -}; - -template -class __compressed_pair : private __compressed_pair_elem<_T1, 0>, - private __compressed_pair_elem<_T2, 1> { -public: - using _Base1 = __compressed_pair_elem<_T1, 0>; - using _Base2 = __compressed_pair_elem<_T2, 1>; - - explicit __compressed_pair(_T1 __t1, _T2 __t2) : _Base1(__t1), _Base2(__t2) {} - - _T1 &first() { return static_cast<_Base1 &>(*this).__get(); } -}; - #if defined(ALTERNATE_LAYOUT) && defined(SUBCLASS_PADDING) template struct __padding { unsigned char __xx[sizeof(_CharT) - 1]; @@ -212,7 +183,7 @@ template class basic_string { }; }; - __compressed_pair<__rep, allocator_type> __r_; + std::__lldb::__compressed_pair<__rep, allocator_type> __r_; public: template