================
@@ -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);
----------------
efriedma-quic wrote:

If we're going to set the context here, should we drop the 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