[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 08:36:02 PDT 2023


erichkeane accepted this revision.
erichkeane added inline comments.
This revision is now accepted and ready to land.


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


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