This revision was automatically updated to reflect the committed changes. Closed by commit rCTE361941: [Index] Correctly set symbol kind of IndirectFieldDecl (authored by ibiryukov, committed by ).
Changed prior to commit: https://reviews.llvm.org/D62573?vs=201837&id=201851#toc Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62573/new/ https://reviews.llvm.org/D62573 Files: clangd/unittests/CodeCompleteTests.cpp Index: clangd/unittests/CodeCompleteTests.cpp =================================================================== --- clangd/unittests/CodeCompleteTests.cpp +++ clangd/unittests/CodeCompleteTests.cpp @@ -449,6 +449,20 @@ 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) {
Index: clangd/unittests/CodeCompleteTests.cpp =================================================================== --- clangd/unittests/CodeCompleteTests.cpp +++ clangd/unittests/CodeCompleteTests.cpp @@ -449,6 +449,20 @@ 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) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits