[PATCH] D138289: [clang][Parse] Remove constant expression from if condition

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 22 08:31:39 PST 2022


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2a1c192bd6bf: [clang][Parse] Remove constant expression from if condition (authored by tbaeder).

Changed prior to commit:
  https://reviews.llvm.org/D138289?vs=476452&id=477210#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138289/new/

https://reviews.llvm.org/D138289

Files:
  clang/lib/Parse/ParseExpr.cpp


Index: clang/lib/Parse/ParseExpr.cpp
===================================================================
--- clang/lib/Parse/ParseExpr.cpp
+++ clang/lib/Parse/ParseExpr.cpp
@@ -3168,7 +3168,7 @@
     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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138289.477210.patch
Type: text/x-patch
Size: 614 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221122/b0b41c56/attachment-0001.bin>


More information about the cfe-commits mailing list