[clang-tools-extra] r361941 - [Index] Correctly set symbol kind of IndirectFieldDecl

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Wed May 29 03:11:14 PDT 2019


Author: ibiryukov
Date: Wed May 29 03:11:14 2019
New Revision: 361941

URL: http://llvm.org/viewvc/llvm-project?rev=361941&view=rev
Log:
[Index] Correctly set symbol kind of IndirectFieldDecl

Summary: The kind has been 'unknown' before, now it is 'field'.

Reviewers: kadircet

Reviewed By: kadircet

Subscribers: jkorous, arphaman, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D62573

Modified:
    clang-tools-extra/trunk/clangd/unittests/CodeCompleteTests.cpp

Modified: clang-tools-extra/trunk/clangd/unittests/CodeCompleteTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/CodeCompleteTests.cpp?rev=361941&r1=361940&r2=361941&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/CodeCompleteTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/CodeCompleteTests.cpp Wed May 29 03:11:14 2019
@@ -449,6 +449,20 @@ TEST(CompletionTest, Kinds) {
   Results = completions("nam^");
   EXPECT_THAT(Results.Completions,
               Has("namespace", CompletionItemKind::Snippet));
+
+  // Members of anonymous unions are of kind 'field'.
+  Results = completions(
+      R"cpp(
+        struct X{
+            union {
+              void *a;
+            };
+        };
+        auto u = X().^
+      )cpp");
+  EXPECT_THAT(
+      Results.Completions,
+      UnorderedElementsAre(AllOf(Named("a"), Kind(CompletionItemKind::Field))));
 }
 
 TEST(CompletionTest, NoDuplicates) {




More information about the cfe-commits mailing list