https://github.com/Troy-Butler created 
https://github.com/llvm/llvm-project/pull/89923

Addresses issue #89805.

Assignment + comparison performed in conditional statement. Resolved by 
parenthesizing comparison operation.

>From cde48906d4b9a08dc436ab94f183c124ee336e5a Mon Sep 17 00:00:00 2001
From: Troy-Butler <squin...@outlook.com>
Date: Wed, 24 Apr 2024 09:23:29 -0400
Subject: [PATCH] [clang][Lex] Reformat suspicious condition

Signed-off-by: Troy-Butler <squin...@outlook.com>
---
 clang/lib/Lex/Pragma.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
 

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to