[PATCH] D53704: [ASTImporter] Import overrides before importing the rest of the chain

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 29 03:21:15 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rC345496: [ASTImporter] Import overrides before importing the rest of the chain (authored by martong, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D53704?vs=171097&id=171471#toc

Repository:
  rC Clang

https://reviews.llvm.org/D53704

Files:
  lib/AST/ASTImporter.cpp


Index: lib/AST/ASTImporter.cpp
===================================================================
--- lib/AST/ASTImporter.cpp
+++ lib/AST/ASTImporter.cpp
@@ -3258,16 +3258,16 @@
     DC->makeDeclVisibleInContext(ToFunction);
   }
 
+  if (auto *FromCXXMethod = dyn_cast<CXXMethodDecl>(D))
+    ImportOverrides(cast<CXXMethodDecl>(ToFunction), FromCXXMethod);
+
   // Import the rest of the chain. I.e. import all subsequent declarations.
   for (++RedeclIt; RedeclIt != Redecls.end(); ++RedeclIt) {
     ExpectedDecl ToRedeclOrErr = import(*RedeclIt);
     if (!ToRedeclOrErr)
       return ToRedeclOrErr.takeError();
   }
 
-  if (auto *FromCXXMethod = dyn_cast<CXXMethodDecl>(D))
-    ImportOverrides(cast<CXXMethodDecl>(ToFunction), FromCXXMethod);
-
   return ToFunction;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53704.171471.patch
Type: text/x-patch
Size: 782 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181029/7cffe773/attachment-0001.bin>


More information about the cfe-commits mailing list