From fcae62d6eeabf0eb926555d56e6a79d880ef094b Mon Sep 17 00:00:00 2001 From: Galina Kistanova Date: Thu, 15 Jun 2017 21:00:40 +0000 Subject: Added braces to work around gcc warning in googletest: suggest explicit braces to avoid ambiguous 'else'. NFC. llvm-svn: 305506 --- llvm/unittests/Support/CommandLineTest.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'llvm/unittests/Support/CommandLineTest.cpp') diff --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp index 7fdd42b..f9dc393 100644 --- a/llvm/unittests/Support/CommandLineTest.cpp +++ b/llvm/unittests/Support/CommandLineTest.cpp @@ -180,8 +180,9 @@ void testCommandLineTokenizer(ParserFunction *parse, StringRef Input, 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, GetRegisteredSubcommands) { 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, GetRegisteredSubcommands) { EXPECT_FALSE(Opt1); EXPECT_FALSE(Opt2); for (auto *S : cl::getRegisteredSubcommands()) { - if (*S) + if (*S) { EXPECT_EQ("sc2", S->getName()); + } } } -- cgit v1.1