1 | template <typename T> struct Base { |
---|---|
2 | Base(T &t) : ref(t), pointer(&t) {} |
3 | // Try referencing `Derived` via different ways to potentially make LLDB |
4 | // pull in the definition (which would recurse back to this base class). |
5 | T &ref; |
6 | T *pointer; |
7 | T func() { return ref; } |
8 | }; |
9 | |
10 | struct Derived : Base<Derived> { |
11 | Derived() : Base<Derived>(*this) {} |
12 | int member = 0; |
13 | }; |
14 | |
15 | Derived derived; |
16 | |
17 | int main() { return derived.member; } |
18 |