[PATCH] D144622: [clang[[ASTImporter] Import TemplateName correctly

DonĂ¡t Nagy via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 1 00:22:16 PST 2023


donat.nagy added a comment.

Basically LGTM (assuming that the TC passes), I added two minor suggestions, but I'm not opposed to merging this in its current state.



================
Comment at: clang/unittests/AST/ASTImporterTest.cpp:8142-8150
+      R"(
+      template <class T>
+      struct A;
+      template <class T>
+      struct A {};
+      template <template<class> class T = A>
+      struct B {};
----------------
Nitpick: consider saving this string in a constant instead of repeating it twice.


================
Comment at: clang/unittests/AST/ASTImporterTest.cpp:8201-8202
+          ->getAsRecordDecl());
+  EXPECT_TRUE(Spec1->getPreviousDecl() == Spec2 ||
+              Spec2->getPreviousDecl() == Spec1);
+  TemplateDecl *Templ1 =
----------------
For clarity, perhaps also assert that Spec1 != Spec2.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144622/new/

https://reviews.llvm.org/D144622



More information about the cfe-commits mailing list