1 // This is a reproducer for a crash in codegen. It happens when we have a
2 // RecordDecl used in an expression and one of the FieldDecl are not complete.
3 // This case happens when:
4 // - A RecordDecl (E) has a FieldDecl which is a reference member variable
5 // - The underlying type of the FieldDec is a TypedefDecl
6 // - The typedef refers to a ClassTemplateSpecialization (DWrapper)
7 // - The typedef is not present in the DeclContext of B
8 // - The typedef shows up as a return value of a member function of E (f())
9 template <typename T> struct DWrapper {};
14 typedef DWrapper<D> DW;
24 NS::DW f() { return {}; };
26 return; //%self.expect("p b_ref", substrs=['(B) $0 =', '(spd = NS::DW', 'a = 0)'])