1struct TopLevelStruct {
2 int i;
3};
4
5// Contains a templated nested class with a typedef.
6struct StructWithNested {
7 template <typename T>
8 struct Nested {
9 // Typedef in a class. Intended to be referenced directly so that it can
10 // trigger the loading of the surrounding classes.
11 typedef TopLevelStruct OtherTypedef;
12 };
13};
14
15// Contains a typedef.
16struct StructWithMember {
17 // This member pulls in the typedef (and classes) above.
18 StructWithNested::Nested<int>::OtherTypedef m;
19 // Typedef in a class. Intended to be referenced directly so that it can
20 // trigger the loading of the surrounding class.
21 typedef int MemberTypedef;
22};
23
24// This is printed and will pull in the typedef in StructWithmember.
25StructWithMember::MemberTypedef pull_in_classes;
26
27
28StructWithMember struct_to_print;
29
30
31int main() {}
32

source code of lldb/test/API/lang/cpp/class-loading-via-member-typedef/main.cpp