aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/lang/cpp/crtp/main.cpp
blob: ed33115b88a93f15867470458cce27dfe2357b8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
template <typename T> struct Base {
  Base(T &t) : ref(t), pointer(&t) {}
  // Try referencing `Derived` via different ways to potentially make LLDB
  // pull in the definition (which would recurse back to this base class).
  T &ref;
  T *pointer;
  T func() { return ref; }
};

struct Derived : Base<Derived> {
  Derived() : Base<Derived>(*this) {}
  int member = 0;
};

Derived derived;

int main() { return derived.member; }