wchilders added inline comments.

================
Comment at: clang/lib/AST/Expr.cpp:2875
 
-  else if (auto *CE = dyn_cast<ConstantExpr>(E))
-    return CE->getSubExpr();
-
   return E;
 }
----------------
`IgnoreParensSingleStep` for some reason has been unwrapping `ConstantExpr`s. 
This results in the constant evaluator, removing the ConstantExpr, and 
reevaluating the expression. There are no observed downsides to removing this 
condition, in the test suite, however, it's strange enough to note.


================
Comment at: clang/lib/AST/ExprConstant.cpp:7329
+      if (Result.isLValue())
+        return Success(Result, E);
+    }
----------------
This doesn't seem to be the right answer, and `ConstantExpr`s don't have 
`LValue` `APValue`s, at least, not that are reaching this case. We had a 
previous implementation that also, kind of punted on this issue with an 
override in `TemporaryExprEvaluator`: 
https://gitlab.com/lock3/clang/-/blob/9fbaeea06fc567ac472264bec2a72661a1e06c73/clang/lib/AST/ExprConstant.cpp#L9753


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76438



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

Reply via email to