diff --git a/clang-tools-extra/unittests/clangd/CodeCompleteTests.cpp b/clang-tools-extra/unittests/clangd/CodeCompleteTests.cpp index d29e8b5ae56f..49b108a60197 100644 --- a/clang-tools-extra/unittests/clangd/CodeCompleteTests.cpp +++ b/clang-tools-extra/unittests/clangd/CodeCompleteTests.cpp @@ -195,7 +195,7 @@ struct ClassWithMembers { int AAA(); int BBB(); int CCC(); -} +}; int main() { ClassWithMembers().^ } )cpp", /*IndexSymbols=*/{}, Opts); @@ -628,7 +628,7 @@ TEST(CompletionTest, NoIncludeInsertionWhenDeclFoundInFile) { R"cpp( namespace ns { class X; - class Y {} + class Y {}; } int main() { ns::^ } )cpp", @@ -651,7 +651,7 @@ TEST(CompletionTest, IndexSuppressesPreambleCompletions) { #include "bar.h" namespace ns { int local; } void f() { ns::^; } - void f() { ns::preamble().$2^; } + void f2() { ns::preamble().$2^; } )cpp"); runAddDocument(Server, File, Test.code()); clangd::CodeCompleteOptions Opts = {}; @@ -1927,7 +1927,7 @@ TEST(CompletionTest, EnableSpeculativeIndexRequest) { namespace ns1 { int abc; } namespace ns2 { int abc; } void f() { ns1::ab$1^; ns1::ab$2^; } - void f() { ns2::ab$3^; } + void f2() { ns2::ab$3^; } )cpp"); runAddDocument(Server, File, Test.code()); clangd::CodeCompleteOptions Opts = {}; diff --git a/clang-tools-extra/unittests/clangd/FindSymbolsTests.cpp b/clang-tools-extra/unittests/clangd/FindSymbolsTests.cpp index 8c9fc2698cca..511c46e3e4d8 100644 --- a/clang-tools-extra/unittests/clangd/FindSymbolsTests.cpp +++ b/clang-tools-extra/unittests/clangd/FindSymbolsTests.cpp @@ -439,7 +439,7 @@ TEST_F(DocumentSymbolsTest, DeclarationDefinition) { TEST_F(DocumentSymbolsTest, ExternSymbol) { std::string FilePath = testPath("foo.cpp"); addFile(testPath("foo.h"), R"cpp( - extern int var = 2; + extern int var; )cpp"); addFile(FilePath, R"cpp( #include "foo.h" diff --git a/clang-tools-extra/unittests/clangd/QualityTests.cpp b/clang-tools-extra/unittests/clangd/QualityTests.cpp index f1a1fdae6b4e..898150f62c47 100644 --- a/clang-tools-extra/unittests/clangd/QualityTests.cpp +++ b/clang-tools-extra/unittests/clangd/QualityTests.cpp @@ -429,7 +429,7 @@ TEST(QualityTests, Operator) { auto Header = TestTU::withHeaderCode(R"cpp( class Foo { public: - bool operator<(const Foo& f1, const Foo& f2); + bool operator<(const Foo& f1); }; )cpp"); auto AST = Header.build(); diff --git a/clang-tools-extra/unittests/clangd/SymbolCollectorTests.cpp b/clang-tools-extra/unittests/clangd/SymbolCollectorTests.cpp index 952fcbef1e93..1829c9ad8412 100644 --- a/clang-tools-extra/unittests/clangd/SymbolCollectorTests.cpp +++ b/clang-tools-extra/unittests/clangd/SymbolCollectorTests.cpp @@ -131,7 +131,7 @@ TEST_F(ShouldCollectSymbolTest, ShouldCollectSymbol) { namespace nx { class X{}; auto f() { int Local; } // auto ensures function body is parsed. - struct { int x } var; + struct { int x; } var; namespace { class InAnonymous {}; } } )",