From 0ce61d47c03df280ce41e226527f8c72fcfa4b13 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Wed, 9 Jun 2021 18:19:49 +0100 Subject: [PATCH] Add explicit braces to silence warning about ambiguous 'else' inside the EXPECT_EQ macro. NFCI. --- clang-tools-extra/clangd/unittests/SelectionTests.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clang-tools-extra/clangd/unittests/SelectionTests.cpp b/clang-tools-extra/clangd/unittests/SelectionTests.cpp index a063c84a6a4c..85b7d9fb541a 100644 --- a/clang-tools-extra/clangd/unittests/SelectionTests.cpp +++ b/clang-tools-extra/clangd/unittests/SelectionTests.cpp @@ -659,10 +659,11 @@ TEST(SelectionTest, CreateAll) { AST.getASTContext(), AST.getTokens(), Test.point("ambiguous"), Test.point("ambiguous"), [&](SelectionTree T) { // Expect to see the right-biased tree first. - if (Seen == 0) + if (Seen == 0) { EXPECT_EQ("BinaryOperator", nodeKind(T.commonAncestor())); - else if (Seen == 1) + } else if (Seen == 1) { EXPECT_EQ("IntegerLiteral", nodeKind(T.commonAncestor())); + } ++Seen; return false; });