================ @@ -13714,6 +13714,12 @@ TreeTransform<Derived>::TransformLambdaExpr(LambdaExpr *E) { // Capturing 'this' is trivial. if (C->capturesThis()) { + // We need ThisType when build capture in CheckCXXThisCapture. ---------------- Sirraide wrote:
```suggestion // If this is a lambda that is part of a default member initialiser // and which we're instantiating outside the class that 'this' is // supposed to refer to, adjust the type of 'this' accordingly. // // Otherwise, leave the type of 'this' as-is. ``` This still only describes *what* we’re doing below, not *why*; what I meant was that we should point out that the reason why we’re pushing a `this` scope here is because we may not be inside the class that `this` is supposed to refer to here; I’d suggest something like this perhaps. https://github.com/llvm/llvm-project/pull/85565 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits