[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:10 PDT 2024


================
@@ -17938,17 +17974,16 @@ void Sema::MarkFunctionReferenced(SourceLocation Loc, FunctionDecl *Func,
 
         if (FirstInstantiation || TSK != TSK_ImplicitInstantiation ||
             Func->isConstexpr()) {
-          if (Func->isConstexpr())
+          if (isa<CXXRecordDecl>(Func->getDeclContext()) &&
+              cast<CXXRecordDecl>(Func->getDeclContext())->isLocalClass() &&
+              CodeSynthesisContexts.size())
+            PendingLocalImplicitInstantiations.push_back(
+                std::make_pair(Func, PointOfInstantiation));
----------------
cor3ntin wrote:

I think this would benefit from a comment

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


More information about the cfe-commits mailing list