================
@@ -1434,13 +1434,18 @@ ExprResult Sema::ActOnCXXThis(SourceLocation Loc) {
return Diag(Loc, diag::err_invalid_this_use) << 0;
}
- return BuildCXXThisExpr(Loc, ThisTy, /*IsImplicit=*/false);
+ return BuildCXXThisExpr(Loc, ThisTy, /*IsImplicit=*/false,
+ SkipLambdaCaptureCheck);
}
-Expr *Sema::BuildCXXThisExpr(SourceLocation Loc, QualType Type,
- bool IsImplicit) {
+Expr *Sema::BuildCXXThisExpr(SourceLocation Loc, QualType Type, bool
IsImplicit,
+ bool SkipLambdaCaptureCheck) {
auto *This = CXXThisExpr::Create(Context, Loc, Type, IsImplicit);
- MarkThisReferenced(This);
+
+ if (!SkipLambdaCaptureCheck) {
----------------
shafik wrote:
Can we provide a standard reference for this code that justifies why we skip
this check here?
https://github.com/llvm/llvm-project/pull/84193
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits