aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/AST/ASTImporter.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp
index 623f912cd5..d6139de3fc 100644
--- a/lib/AST/ASTImporter.cpp
+++ b/lib/AST/ASTImporter.cpp
@@ -4193,8 +4193,11 @@ DeclContext *ASTImporter::ImportContext(DeclContext *FromDC) {
// When we're using a record declaration as a context, we need it to have
// a definition.
ASTNodeImporter Importer(*this);
- Importer.ImportDefinition(cast<RecordDecl>(FromDC), ToRecord,
- ASTNodeImporter::IDK_Basic);
+
+ RecordDecl *FromRecord = cast<RecordDecl>(FromDC);
+ if (FromRecord->isCompleteDefinition())
+ Importer.ImportDefinition(FromRecord, ToRecord,
+ ASTNodeImporter::IDK_Basic);
}
return ToDC;