================
@@ -503,6 +503,13 @@ void Sema::handleLambdaNumbering(
   MangleNumberingContext *MCtx;
   std::tie(MCtx, Numbering.ContextDecl) =
       getCurrentMangleNumberContext(Class->getDeclContext());
+  // getManglingNumber(Method) below may trigger mangling of dependent types
+  // that reference init-captures. Publish the lambda context declaration early
+  // so such mangling can resolve the surrounding context without recursing
+  // through the lambda call operator. This avoids publishing provisional
+  // numbering state before final numbering is assigned below.
+  if (Numbering.ContextDecl)
+    Class->setLambdaContextDecl(Numbering.ContextDecl);
----------------
oToToT wrote:

I was also thinking about this, but I'm not sure if this is preferred. Anyway, 
the updated commit drops `ContextDecl` from `CXXRecordDecl::LambdaNumbering`.

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

Reply via email to