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

Corentin Jabot via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 6 12:46:12 PDT 2023


cor3ntin added inline comments.


================
Comment at: clang/lib/Sema/SemaLambda.cpp:2263
+        LocalInstantiationScope &Scope)
+    : FunctionScope(SemasRef) {
+  if (!isLambdaCallOperator(FD)) {
----------------
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!


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