[PATCH] D49245: [ASTImporter] Import implicit methods of existing class.

Aleksei Sidorin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 14 22:42:03 PDT 2018


a_sidorin accepted this revision.
a_sidorin added a comment.
This revision is now accepted and ready to land.

LGTM. Just some stylish nits.
To resolve this issue, I used `Sema::DeclareImplicit...` methods. But I like this approach much more because it doesn't allows to forget different kinds of implicit methods and doesn't require passing Sema into ASTImporter.



================
Comment at: lib/AST/ASTImporter.cpp:2203
+              if (D->isCompleteDefinition() && !Importer.isMinimalImport())
+                // FoundDef may not have every implicit method that D has.
+                ImportImplicitMethods(DCXX, FoundCXX);
----------------
... because implicit methods are created only if they are used.


================
Comment at: unittests/AST/ASTImporterTest.cpp:2302
+      const MatcherType &MethodMatcher, const char *Code = DefaultCode) {
+    test(MethodMatcher, Code, 1u);
+  }
----------------
/*ExpectedCount=*/. Same below.


================
Comment at: unittests/AST/ASTImporterTest.cpp:2305
+
+  template<typename MatcherType>
+  void testNoImportOf(
----------------
clang-format places a space before the template parameter list.


Repository:
  rC Clang

https://reviews.llvm.org/D49245





More information about the cfe-commits mailing list