[Lldb-commits] [lldb] [LLDB] Update DIL to handle smart pointers; add more tests. (PR #143786)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Tue Jun 24 07:07:48 PDT 2025
================
@@ -0,0 +1,25 @@
+#include <memory>
+
+int main(int argc, char **argv) {
+
+ struct NodeU {
+ std::unique_ptr<NodeU> next;
+ int value;
+ };
+ auto ptr_node = std::unique_ptr<NodeU>(new NodeU{nullptr, 2});
+ ptr_node = std::unique_ptr<NodeU>(new NodeU{std::move(ptr_node), 1});
+
+ std::unique_ptr<char> ptr_null;
+ auto ptr_int = std::make_unique<int>(1);
+ auto ptr_float = std::make_unique<float>(1.1f);
+
+ auto deleter = [](void const *data) {
+ delete static_cast<int const *>(data);
+ };
+ std::unique_ptr<void, decltype(deleter)> ptr_void(new int(42), deleter);
+
+ // TestUniquePtr
+ // TestUniquePtrDeref
+ // TestUniquePtrCompare
----------------
labath wrote:
?
https://github.com/llvm/llvm-project/pull/143786
More information about the lldb-commits
mailing list