================
@@ -21964,11 +22000,23 @@ bool Expr::EvaluateAsRValue(EvalResult &Result, const 
ASTContext &Ctx,
   assert(!isValueDependent() &&
          "Expression evaluator can't be called on a dependent expression.");
   ExprTimeTraceScope TimeScope(this, Ctx, "EvaluateAsRValue");
-  EvalInfo Info(Ctx, Result, EvaluationMode::IgnoreSideEffects);
+  EvalInfo Info(Ctx, /*Sema=*/nullptr, Result,
+                EvaluationMode::IgnoreSideEffects);
   Info.InConstantContext = InConstantContext;
   return ::EvaluateAsRValue(this, Result, Ctx, Info);
 }
 
+bool Expr::EvaluateAsMandatedConstantRValue(EvalResult &Result,
----------------
shafik wrote:

I am not crazy that this is `Expr::EvaluateAsRValue` w/ some minor 
modifications. Duplicated code are always bug magnets and we should avoid them 
if possible. 

Maybe we can created a private member they both call?

https://github.com/llvm/llvm-project/pull/205557
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to