[llvm] r304083 - Added braces to address gcc warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]. NFC.

Galina Kistanova via llvm-commits llvm-commits at lists.llvm.org
Sat May 27 20:50:52 PDT 2017


Author: gkistanova
Date: Sat May 27 22:50:52 2017
New Revision: 304083

URL: http://llvm.org/viewvc/llvm-project?rev=304083&view=rev
Log:
Added braces to address gcc warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]. NFC.

Modified:
    llvm/trunk/unittests/Support/CommandLineTest.cpp

Modified: llvm/trunk/unittests/Support/CommandLineTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/CommandLineTest.cpp?rev=304083&r1=304082&r2=304083&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/CommandLineTest.cpp (original)
+++ llvm/trunk/unittests/Support/CommandLineTest.cpp Sat May 27 22:50:52 2017
@@ -180,8 +180,9 @@ void testCommandLineTokenizer(ParserFunc
   parse(Input, Saver, Actual, /*MarkEOLs=*/false);
   EXPECT_EQ(OutputSize, Actual.size());
   for (unsigned I = 0, E = Actual.size(); I != E; ++I) {
-    if (I < OutputSize)
+    if (I < OutputSize) {
       EXPECT_STREQ(Output[I], Actual[I]);
+    }
   }
 }
 
@@ -528,8 +529,9 @@ TEST(CommandLineTest, GetRegisteredSubco
   EXPECT_FALSE(Opt1);
   EXPECT_FALSE(Opt2);
   for (auto *S : cl::getRegisteredSubcommands()) {
-    if (*S)
+    if (*S) {
       EXPECT_EQ("sc1", S->getName());
+    }
   }
 
   cl::ResetAllOptionOccurrences();
@@ -538,8 +540,9 @@ TEST(CommandLineTest, GetRegisteredSubco
   EXPECT_FALSE(Opt1);
   EXPECT_FALSE(Opt2);
   for (auto *S : cl::getRegisteredSubcommands()) {
-    if (*S)
+    if (*S) {
       EXPECT_EQ("sc2", S->getName());
+    }
   }
 }
 




More information about the llvm-commits mailing list