[PATCH] D159465: Add index test with unconstrained auto.

Jens Massberg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 6 08:11:06 PDT 2023


massberg created this revision.
massberg added a reviewer: sammccall.
Herald added a subscriber: arphaman.
Herald added a project: All.
massberg requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Without the fix in https://reviews.llvm.org/D159450 the new test would
fail.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D159465

Files:
  clang/unittests/Index/IndexTests.cpp


Index: clang/unittests/Index/IndexTests.cpp
===================================================================
--- clang/unittests/Index/IndexTests.cpp
+++ clang/unittests/Index/IndexTests.cpp
@@ -428,6 +428,19 @@
                              WrittenAt(Position(3, 15)))));
 }
 
+TEST(IndexTest, UnconstrainedAuto) {
+  std::string Code = R"cpp(
+    template <typename T>
+    class Client {
+      template <const auto& S>
+      void foo() {
+      }
+    };
+  )cpp";
+  auto Index = std::make_shared<Indexer>();
+  tooling::runToolOnCode(std::make_unique<IndexAction>(Index), Code);
+  EXPECT_THAT(Index->Symbols, Contains(AllOf(QName("Client::foo"))));
+}
 } // namespace
 } // namespace index
 } // namespace clang


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159465.556042.patch
Type: text/x-patch
Size: 724 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230906/a2096cf4/attachment-0001.bin>


More information about the cfe-commits mailing list