[NFC][Driver] Fix -Wdangling-else warning
authorMichael Platings <michael.platings@arm.com>
Thu, 18 May 2023 20:14:56 +0000 (21:14 +0100)
committerMichael Platings <michael.platings@arm.com>
Thu, 18 May 2023 20:16:56 +0000 (21:16 +0100)
GCC emits this warning because the EXPECT_STREQ macro contains an
if-else statement:

  warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]

clang/unittests/Driver/DXCModeTest.cpp

index c30f3c3..b3767c0 100644 (file)
@@ -137,8 +137,9 @@ TEST(DxcModeTest, ValidatorVersionValidation) {
     auto *A = TranslatedArgs->getLastArg(
         clang::driver::options::OPT_dxil_validator_version);
     EXPECT_NE(A, nullptr);
-    if (A)
+    if (A) {
       EXPECT_STREQ(A->getValue(), "1.1");
+    }
   }
   EXPECT_EQ(Diags.getNumErrors(), 0u);