[PATCH] D159126: [Clang] Add captures to the instantiation scope of lambda call operators

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 6 12:47:37 PDT 2023


erichkeane added inline comments.


================
Comment at: clang/lib/Sema/SemaLambda.cpp:2263
+        LocalInstantiationScope &Scope)
+    : FunctionScope(SemasRef) {
+  if (!isLambdaCallOperator(FD)) {
----------------
cor3ntin wrote:
> erichkeane wrote:
> > cor3ntin wrote:
> > > erichkeane wrote:
> > > > Wonder if `LambdaScopeForCallOperatorInstantiationRAII` should just inherit from `FunctionScopeRAII? Am I missing why not?
> > > I suppose it could yes. I think it would have to be protected so that `disable` is not misused 
> > Ah, this isn't the object I thought it was (the actual scope), just the RAII, so I think this is all right/not much benefit to it.
> > 
> > I was afraid it was the actual 'scope' object, so introspection into the list of active scopes would pull us into some private variable/init somewhere rather than the ctor of the containing object.  No reason to change this now.
> Oups, I missed your reply and changed it. Hopefully you are still happy with it!
Yep, no problem with it now, a bit of a brainfart when I suggested it in the first place.  Still LGTM.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D159126



More information about the cfe-commits mailing list