[clang] [clang][Sema] Fix a bug when instantiating a lambda with requires clause (PR #65193)

via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 13 02:21:58 PDT 2023


0x59616e wrote:

> There is also the question of what happen in the deeply nested case
> 
> ```c++
> int foo(auto...);
> auto f(auto... a) {
>    return [] {
>            return [] () requires requires { foo(a...) ;} {};
>    }();
> }
> 
> auto g = f()();
> ```
> 
> we may have to visit all functions recursively from the bottom up to add their locals / parameters / captures

How deep the nested level should we support ? Support for two levels is easy, but three (or more) levels is complicated. I wonder whether the three (or more) nested levels is common enough that deserves the support. Any thought ?

https://github.com/llvm/llvm-project/pull/65193


More information about the cfe-commits mailing list