================
@@ -13905,6 +13911,31 @@ TreeTransform<Derived>::TransformLambdaExpr(LambdaExpr 
*E) {
                                     /*IsInstantiation*/ true);
   SavedContext.pop();
 
+  // Recompute the dependency of the lambda so that we can defer the lambda 
call
+  // construction until after we have sufficient template arguments. For
+  // example, template <class> struct S {
+  //   template <class U>
+  //   using Type = decltype([](U){}(42.0));
+  // };
+  // void foo() {
+  //   using T = S<int>::Type<float>;
+  //             ^~~~~~
+  // }
+  // We would end up here from instantiating the S<int> as we're ensuring the
+  // completeness. That would make us transform the lambda call expression
+  // despite the fact that we don't see the argument for U yet. We have a
----------------
cor3ntin wrote:

```suggestion
  // We would end up here from instantiating S<int> when ensuring its
  // completeness. That would make us transform the lambda call expression
  // despite the fact that we don't have a corresponding argument for U yet. We 
have a
```

https://github.com/llvm/llvm-project/pull/82310
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to