[clang] [Clang] Reconsider the timing of instantiation of local constexpr lambdas (PR #98758)

via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 14 05:00:11 PDT 2024


================
@@ -16983,6 +16995,30 @@ Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result,
   SmallVector<PartialDiagnosticAt, 8> Notes;
   EvalResult.Diag = &Notes;
 
+  // Check if the expression refers to local functions yet to be instantiated.
+  // If so, instantiate them now, as the constant evaluation requires the
+  // function definition.
+  if (!PendingLocalImplicitInstantiations.empty()) {
----------------
cor3ntin wrote:

Can you explain why we check for not having pending instantiations ?

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


More information about the cfe-commits mailing list