1namespace N0 {
2namespace N1 {
3
4namespace {
5enum Enum { Enum_0 = 1, Enum_1 = 2, Enum_2 = 4, Enum_3 = 8 };
6enum class ScopedEnum { Enum_0 = 1, Enum_1 = 2, Enum_2 = 4, Enum_3 = 8 };
7}
8
9Enum Global = Enum_3;
10
11struct Base {
12 Enum m_e = Enum_1;
13};
14
15class Class : public Base {
16public:
17 Class(Enum e) : m_ce(e) {}
18
19 static int StaticFunc(const Class &c) {
20 return c.PrivateFunc(i: c.m_inner) + Global + ClassStatic;
21 }
22
23 const Enum m_ce;
24
25 static int ClassStatic;
26 static const int ClassStaticConst = 8;
27 static constexpr int ClassStaticConstexpr = 9;
28 static constexpr float ClassStaticConstexprFloat = 10.f;
29 static constexpr double ClassStaticConstexprDouble = 11.0;
30 static constexpr long double ClassStaticConstexprLongDouble = 12.0;
31 static const Enum ClassStaticConstEnum = Enum_3;
32 static const ScopedEnum ClassStaticConstScopedEnum = ScopedEnum::Enum_2;
33
34private:
35 struct Inner {
36 char x;
37 short y;
38 int z;
39 };
40
41 int PrivateFunc(const Inner &i) const { return i.z; }
42
43 Inner m_inner{};
44};
45int Class::ClassStatic = 7;
46
47template<typename T>
48struct Template {
49 template<Enum E>
50 void TemplateFunc() {
51 T::StaticFunc(T(E));
52 }
53};
54
55void foo() { Template<Class>().TemplateFunc<Enum_0>(); }
56
57} // namespace N1
58} // namespace N0
59
60int main() {
61 N0::N1::foo();
62 return 0;
63}
64

source code of lldb/test/Shell/SymbolFile/PDB/Inputs/AstRestoreTest.cpp