[PATCH] D137244: [Clang] Correctly capture bindings in dependent lambdas.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 9 08:42:27 PST 2023


aaron.ballman added inline comments.


================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:125
+                    diag::err_param_default_argument_references_local)
+             << D->getDeclName() << DefaultArg->getSourceRange();
   }
----------------
aaron.ballman wrote:
> `ValueDecl` is a subclass of `NamedDecl` and the diagnostic printer knows how to properly print those -- I assume this is an NFC change (or near enough to it).
Did this one not work the way I expected?


================
Comment at: clang/lib/Sema/SemaExpr.cpp:19648-19649
     // odr-used, but we may still need to track them for lambda capture.
     // FIXME: Do we also need to do this inside dependent typeid expressions
     // (which are modeled as unevaluated at this point)?
+    DoMarkPotentialCapture(SemaRef, Loc, Var, E);
----------------
cor3ntin wrote:
> aaron.ballman wrote:
> > Should this comment be moved elsewhere, as it now seems detached from the original logic.
> I think it's still relevant. the logic is still doing lambda captures, and we still don't need to do anything else, and the fixme is not resolved.
Okay, fine by me, I thought it might make more sense in `DoMarkPotentialCapture`, but I see now that the comment relates more to where it is currently.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137244/new/

https://reviews.llvm.org/D137244



More information about the cfe-commits mailing list