[clang][Parse] Remove constant expression from if condition
authorTimm Bäder <tbaeder@redhat.com>
Fri, 18 Nov 2022 13:13:18 +0000 (14:13 +0100)
committerTimm Bäder <tbaeder@redhat.com>
Tue, 22 Nov 2022 16:31:21 +0000 (17:31 +0100)
MaybeTypeCast here is not a variable, it's an enum member with value 1.

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

clang/lib/Parse/ParseExpr.cpp

index 20ce560..9ac8706 100644 (file)
@@ -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);