[clang] 6f390ea - [Lex] Fix clang -Wparentheses after #89923

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 29 13:47:13 PDT 2024


Author: Fangrui Song
Date: 2024-04-29T13:47:09-07:00
New Revision: 6f390ea60d987f6e1e027d1c72982c2eb7896005

URL: https://github.com/llvm/llvm-project/commit/6f390ea60d987f6e1e027d1c72982c2eb7896005
DIFF: https://github.com/llvm/llvm-project/commit/6f390ea60d987f6e1e027d1c72982c2eb7896005.diff

LOG: [Lex] Fix clang -Wparentheses after #89923

Added: 
    

Modified: 
    clang/lib/Lex/Pragma.cpp

Removed: 
    


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


        


More information about the cfe-commits mailing list