Skip to content

Commit 1ad1308

Browse files
[clangd] Assert that the testcases in FindExplicitReferencesTest.All have no diagnostics
Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72355
1 parent a6342c2 commit 1ad1308

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

clang-tools-extra/clangd/unittests/FindTargetTests.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,10 @@ class FindExplicitReferencesTest : public ::testing::Test {
566566
TU.ExtraArgs.push_back("-std=c++17");
567567

568568
auto AST = TU.build();
569+
for (auto &D : AST.getDiagnostics()) {
570+
if (D.Severity > DiagnosticsEngine::Warning)
571+
ADD_FAILURE() << D << Code;
572+
}
569573

570574
auto *TestDecl = &findDecl(AST, "foo");
571575
if (auto *T = llvm::dyn_cast<FunctionTemplateDecl>(TestDecl))
@@ -718,7 +722,7 @@ TEST_F(FindExplicitReferencesTest, All) {
718722
"3: targets = {vb}, decl\n"},
719723
// MemberExpr should know their using declaration.
720724
{R"cpp(
721-
struct X { void func(int); }
725+
struct X { void func(int); };
722726
struct Y : X {
723727
using X::func;
724728
};
@@ -824,7 +828,7 @@ TEST_F(FindExplicitReferencesTest, All) {
824828
void foo() {
825829
$0^TT<int> $1^x;
826830
$2^foo<$3^TT>();
827-
$4^foo<$5^vector>()
831+
$4^foo<$5^vector>();
828832
$6^foo<$7^TP...>();
829833
}
830834
)cpp",
@@ -924,7 +928,7 @@ TEST_F(FindExplicitReferencesTest, All) {
924928
// Namespace aliases should be handled properly.
925929
{
926930
R"cpp(
927-
namespace ns { struct Type {} }
931+
namespace ns { struct Type {}; }
928932
namespace alias = ns;
929933
namespace rec_alias = alias;
930934

0 commit comments

Comments
 (0)