Debian Codegraph @

lldb/test/API/commands/frame/var-dil/basics/SyntheticDereference/main.cpp

raw
1 #include <memory>
2
3 struct NodeS;
4
5 // Class to wrap pointers.
6 class wrap_ptr {
7 public:
8 NodeS *ptr;
9
10 wrap_ptr(NodeS *n_ptr) : ptr(n_ptr) {}
11 };
12
13 struct NodeS {
14 wrap_ptr next;
15 int value;
16
17 NodeS(NodeS *n_ptr, int val) : next(wrap_ptr(n_ptr)), value(val) {}
18 };
19
20 int main(int argc, char **argv) {
21
22 // Make a short linked list of fake smart pointers.
23 auto ptr_node = wrap_ptr(new NodeS(new NodeS(nullptr, 2), 1));
24
25 return 0; // Set a breakpoint here
26 }