[clang-tools-extra] 0ce61d4 - Add explicit braces to silence warning about ambiguous 'else' inside the EXPECT_EQ macro. NFCI.

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 10 03:09:23 PDT 2021


Author: Simon Pilgrim
Date: 2021-06-10T10:55:24+01:00
New Revision: 0ce61d47c03df280ce41e226527f8c72fcfa4b13

URL: https://github.com/llvm/llvm-project/commit/0ce61d47c03df280ce41e226527f8c72fcfa4b13
DIFF: https://github.com/llvm/llvm-project/commit/0ce61d47c03df280ce41e226527f8c72fcfa4b13.diff

LOG: Add explicit braces to silence warning about ambiguous 'else' inside the EXPECT_EQ macro. NFCI.

Added: 
    

Modified: 
    clang-tools-extra/clangd/unittests/SelectionTests.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/unittests/SelectionTests.cpp b/clang-tools-extra/clangd/unittests/SelectionTests.cpp
index a063c84a6a4ca..85b7d9fb541a1 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;
       });


        


More information about the cfe-commits mailing list