================
@@ -19000,7 +19056,7 @@ bool Sema::tryCaptureVariable(
Explicit = false;
FunctionScopesIndex--;
if (IsInScopeDeclarationContext)
- DC = ParentDC;
+ DC = skipRequiresBody(ParentDC);
----------------
mizvekov wrote:
That is one of your tests actually:
`clang/test/SemaCXX/lambda-unevaluated.cpp`
```C++
// GH88081: Test if we evaluate the requires expression with lambda captures
properly.
namespace GH88081 {
// Test that ActOnLambdaClosureQualifiers() is called only once.
void foo(auto value)
requires requires { [&] -> decltype(value) {}; }
// expected-error@-1 {{non-local lambda expression cannot have a
capture-default}}
{}
```
The difference is that now the requires expression is properly reparented to
`foo`, where as before it would just sit at the namespace.
https://github.com/llvm/llvm-project/pull/107942
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits