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


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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to