[clang] 99ce84c - [clang][NFC] Reformat suspicious condition (#89923)

via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 29 12:24:33 PDT 2024


Author: Troy Butler
Date: 2024-04-29T21:24:29+02:00
New Revision: 99ce84cef0185fe9eaec51e40ea80f69f06981f0

URL: https://github.com/llvm/llvm-project/commit/99ce84cef0185fe9eaec51e40ea80f69f06981f0
DIFF: https://github.com/llvm/llvm-project/commit/99ce84cef0185fe9eaec51e40ea80f69f06981f0.diff

LOG: [clang][NFC] Reformat suspicious condition (#89923)

Addresses issue #89805.
Assignment + comparison performed in conditional statement. Resolved by
parenthesizing comparison operation.

Fixes #89805.

---------

Signed-off-by: Troy-Butler <squintik at outlook.com>

Added: 
    

Modified: 
    clang/lib/Lex/Pragma.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp
index 499813f8ab7df0..ced407355e0015 100644
--- a/clang/lib/Lex/Pragma.cpp
+++ b/clang/lib/Lex/Pragma.cpp
@@ -1444,7 +1444,7 @@ struct PragmaWarningHandler : public PragmaHandler {
                                  .Case("once", PPCallbacks::PWS_Once)
                                  .Case("suppress", PPCallbacks::PWS_Suppress)
                                  .Default(-1);
-          if ((SpecifierValid = SpecifierInt != -1))
+          if (SpecifierValid = (SpecifierInt != -1))
             Specifier =
                 static_cast<PPCallbacks::PragmaWarningSpecifier>(SpecifierInt);
 


        


More information about the cfe-commits mailing list