================
@@ -1113,10 +1113,14 @@ void 
Sema::ActOnLambdaExpressionAfterIntroducer(LambdaIntroducer &Intro,
     // The parameter var is not injected into the function Decl at the point of
     // parsing lambda. In such scenarios, perceiving it as dependent could
     // result in the constraint being evaluated, which matches what GCC does.
-    while (P->getEntity() && P->getEntity()->isRequiresExprBody())
-      P = P->getParent();
-    if (P->isFunctionDeclarationScope() &&
-        llvm::any_of(P->decls(), [](Decl *D) {
+    Scope *LookupScope = ParentScope;
+    while (LookupScope->getEntity() &&
+           LookupScope->getEntity()->isRequiresExprBody())
----------------
ojhunt wrote:

I do recognize that this might be over engineering, a dev could always do

```cpp
while (TheirOwnAdditionalConstraints(S)) S = S->getParentIgnoringTransparent();
```

Which as I read it may be much easier to reason about than a filter predicate, 
so having written this I think the filter predicate approach is much harder to 
reason about.

https://github.com/llvm/llvm-project/pull/173776
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to