[cfe-commits] r148894 - /cfe/trunk/lib/AST/ASTImporter.cpp

Douglas Gregor dgregor at apple.com
Tue Jan 24 17:13:21 PST 2012


Author: dgregor
Date: Tue Jan 24 19:13:20 2012
New Revision: 148894

URL: http://llvm.org/viewvc/llvm-project?rev=148894&view=rev
Log:
Only try to import a definition if there is an definition to import.

Modified:
    cfe/trunk/lib/AST/ASTImporter.cpp

Modified: cfe/trunk/lib/AST/ASTImporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=148894&r1=148893&r2=148894&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTImporter.cpp (original)
+++ cfe/trunk/lib/AST/ASTImporter.cpp Tue Jan 24 19:13:20 2012
@@ -4193,8 +4193,11 @@
     // 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;





More information about the cfe-commits mailing list