| 1 | struct TopLevelStruct { |
| 2 | int i; |
| 3 | }; |
| 4 | |
| 5 | // Contains a templated nested class with a typedef. |
| 6 | struct 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. |
| 16 | struct 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. |
| 25 | StructWithMember::MemberTypedef pull_in_classes; |
| 26 | |
| 27 | |
| 28 | StructWithMember struct_to_print; |
| 29 | |
| 30 | |
| 31 | int main() {} |
| 32 | |