been completed yet, then complete it if possible.
This fixes some assertion failures encountered by
LLDB.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150020
91177308-0d34-0410-b5e6-
96231b3b80d8
// as soon as we begin to parse the definition. That definition is
// not a complete definition (which is what isDefinition() tests)
// until we *finish* parsing the definition.
+
+ if (D->hasExternalLexicalStorage() && !D->getDefinition())
+ getExternalSource()->CompleteType(const_cast<RecordDecl*>(D));
+
D = D->getDefinition();
assert(D && "Cannot get layout of forward declarations!");
assert(D->isCompleteDefinition() && "Cannot layout type before complete!");