diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-25 01:13:20 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-25 01:13:20 +0000 |
commit | 568991b62a29c1919e67438e0ac8216715b2c760 (patch) | |
tree | ec6453a3526c23a80d4016be312cbe62a52381e0 | |
parent | 3add9f0ac80b0a4d78611dcdb4fd89c37f1c13d8 (diff) |
Only try to import a definition if there is an definition to import.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148894 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/AST/ASTImporter.cpp | 7 |
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; |