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

Very neat! A few minor suggestions but generally looks good.



================
Comment at: clang-tools-extra/clangd/AST.cpp:519
+      if (Spec->getTemplateSpecializationKind() != TSK_ImplicitInstantiation)
+        continue;
+      // Find the type for this specialization.
----------------
Should we `break` in this case? Otherwise there could be an explicit 
specialization with a second type


================
Comment at: clang-tools-extra/clangd/AST.cpp:545
+  // TemplateTypeParmTypes for implicit TTPs, instead of AutoTypes.
+  // Also we don't look very hard, just stripping const, references, pointers.
+  static TemplateTypeParmTypeLoc findContainedAutoTTPLoc(TypeLoc TL) {
----------------
Maybe call out an example like `vector<auto>` as a future nice-to-handle?


================
Comment at: clang-tools-extra/clangd/unittests/tweaks/ExpandAutoTypeTests.cpp:88
+              StartsWith("fail: Could not deduce"));
+  EXPECT_EQ(apply("auto X = [](^auto){return 0;}; int Y = X(42);"),
+            "auto X = [](int){return 0;}; int Y = X(42);");
----------------
Maybe add a conflicting-deduction case? (I know the GetDeducedType test already 
has one, but here it would be especially wrong.)

Also, should we perhaps disable this in header files (maybe excepting 
function-local symbols), since an including source file could have additional 
instantiations?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119537

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to