diff --git a/clang-tools-extra/clangd/unittests/FindTargetTests.cpp b/clang-tools-extra/clangd/unittests/FindTargetTests.cpp --- a/clang-tools-extra/clangd/unittests/FindTargetTests.cpp +++ b/clang-tools-extra/clangd/unittests/FindTargetTests.cpp @@ -566,6 +566,9 @@ TU.ExtraArgs.push_back("-std=c++17"); auto AST = TU.build(); + for (auto &D : AST.getDiagnostics()) + ADD_FAILURE() << D << Code; + assert(AST.getDiagnostics().empty()); auto *TestDecl = &findDecl(AST, "foo"); if (auto *T = llvm::dyn_cast(TestDecl)) @@ -663,7 +666,7 @@ void foo() { $0^Struct $1^x; $2^Typedef $3^y; - static_cast<$4^Struct*>(0); + (void)static_cast<$4^Struct*>(0); } )cpp", "0: targets = {Struct}\n" @@ -718,7 +721,7 @@ "3: targets = {vb}, decl\n"}, // MemberExpr should know their using declaration. {R"cpp( - struct X { void func(int); } + struct X { void func(int); }; struct Y : X { using X::func; }; @@ -744,7 +747,7 @@ #define BAR b void foo(int a, int b) { - $0^FOO+$1^BAR; + (void)($0^FOO+$1^BAR); } )cpp", "0: targets = {a}\n" @@ -824,7 +827,7 @@ void foo() { $0^TT $1^x; $2^foo<$3^TT>(); - $4^foo<$5^vector>() + $4^foo<$5^vector>(); $6^foo<$7^TP...>(); } )cpp", @@ -891,7 +894,7 @@ }; // delegating initializer class $10^Foo { - $11^Foo(int); + $11^Foo(int) {} $12^Foo(): $13^Foo(111) {} }; } @@ -924,7 +927,7 @@ // Namespace aliases should be handled properly. { R"cpp( - namespace ns { struct Type {} } + namespace ns { struct Type {}; } namespace alias = ns; namespace rec_alias = alias;