23 lines · cpp
1#include "shared.h"2 3struct WrapperA {4 OuterY::Inner<unsigned int> y;5};6 7int main() {8 // WrapperA refers to the Inner and Outer class DIEs from this CU.9 WrapperA a;10 // WrapperB refers to the Inner and Outer DIEs from the other.cpp CU.11 // It is important that WrapperB is only forward-declared in shared.h.12 WrapperB* b = foo();13 14 // Evaluating 'b' here will parse other.cpp's DIEs for all15 // the Inner and Outer classes from shared.h.16 //17 // Evaluating 'a' here will find and reuse the already-parsed18 // versions of the Inner and Outer classes. In the associated test19 // we make sure that we can still resolve all the types properly20 // by evaluating 'a.y.oY_inner.oX_inner'.21 return 0; // break here22}23