[clang] [Clang] Instantiate functions from constant evaluation. (PR #205557)

Corentin Jabot via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 24 07:18:42 PDT 2026


================
@@ -22652,12 +22745,13 @@ static bool EvaluateCharRangeAsStringImpl(const Expr *, T &Result,
                                           const Expr *PtrExpression,
                                           ASTContext &Ctx,
                                           Expr::EvalResult &Status) {
-  EvalInfo Info(Ctx, Status, EvaluationMode::ConstantExpression);
+  EvalInfo Info(Ctx, /*Sema=*/nullptr, Status,
+                 EvaluationMode::ConstantExpression);
   Info.InConstantContext = true;
----------------
cor3ntin wrote:

See, this is wrong.
This can be called for the message of a static_assert - afaik that's the only use - and that is definitively a constant expression
https://eel.is/c++draft/dcl.pre#13 


This is the crux of my concern with this approach - we are going to miss spots.
(note that I'm happy to go with that if the community prefers it)

https://github.com/llvm/llvm-project/pull/205557


More information about the cfe-commits mailing list