Author: Timm Bäder
Date: 2022-11-22T17:31:21+01:00
New Revision: 2a1c192bd6bf639bc3f14cfb19c5d7aff5e7794b

URL: 
https://github.com/llvm/llvm-project/commit/2a1c192bd6bf639bc3f14cfb19c5d7aff5e7794b
DIFF: 
https://github.com/llvm/llvm-project/commit/2a1c192bd6bf639bc3f14cfb19c5d7aff5e7794b.diff

LOG: [clang][Parse] Remove constant expression from if condition

MaybeTypeCast here is not a variable, it's an enum member with value 1.

Differential Revision: https://reviews.llvm.org/D138289

Added: 
    

Modified: 
    clang/lib/Parse/ParseExpr.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp
index 20ce560514e94..9ac8706191d3a 100644
--- a/clang/lib/Parse/ParseExpr.cpp
+++ b/clang/lib/Parse/ParseExpr.cpp
@@ -3168,7 +3168,7 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, 
bool stopIfCastExpr,
     InMessageExpressionRAIIObject InMessage(*this, false);
 
     Result = ParseExpression(MaybeTypeCast);
-    if (!getLangOpts().CPlusPlus && MaybeTypeCast && Result.isUsable()) {
+    if (!getLangOpts().CPlusPlus && Result.isUsable()) {
       // Correct typos in non-C++ code earlier so that implicit-cast-like
       // expressions are parsed correctly.
       Result = Actions.CorrectDelayedTyposInExpr(Result);


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

Reply via email to