[PATCH] D52775: [clangd] Add a #include completion test that triggers an assertion.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 2 07:47:51 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE343593: [clangd] Add a #include completion test that triggers an assertion. (authored by hokein, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D52775?vs=167908&id=167949#toc

Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D52775

Files:
  unittests/clangd/CodeCompleteTests.cpp


Index: unittests/clangd/CodeCompleteTests.cpp
===================================================================
--- unittests/clangd/CodeCompleteTests.cpp
+++ unittests/clangd/CodeCompleteTests.cpp
@@ -2093,6 +2093,15 @@
                     Has("bar.h\"", CompletionItemKind::File)));
 }
 
+TEST(CompletionTest, NoCrashAtNonAlphaIncludeHeader) {
+  auto Results = completions(
+      R"cpp(
+        #include "./^"
+      )cpp"
+      );
+  EXPECT_TRUE(Results.Completions.empty());
+}
+
 TEST(CompletionTest, NoAllScopesCompletionWhenQualified) {
   clangd::CodeCompleteOptions Opts = {};
   Opts.AllScopes = true;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52775.167949.patch
Type: text/x-patch
Size: 619 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181002/8944a361/attachment.bin>


More information about the cfe-commits mailing list