Description
id: P0588R1
paper: https://wg21.link/P0588R1
This paper doesn't have a tracking issue in the C++20 project yet1. It also shows up on the cppreference implementation status page, and presumably should be tracked in https://clang.llvm.org/cxx_status.html (like other DRs that have a Pxxxx).
I found some related issues2, but none dedicated to this:
- Incorrect
if constexpr
evaluation in nested generic lambda #58872 - Erroneous
if constexpr
instantiation in lambda template #44851 - decltype for lambda capture gives wrong type #37673
- decltype((x)) inside lambda is considered odr-use if x is captured #34771
Most recently, @erichkeane wrote in #58872:
DR status is tracked here : https://clang.llvm.org/cxx_dr_status.html
So it would be tracked there as CWG1632 and CWG1913.
From the looks of it, implementation will likely quickly get into a "thar be dragons" part of the compiler. We need to suppress instantiation of the body of dependent lambdas (the easy part), but getInstantiationArgs likely needs updating for it (which is a function that had some serious problems) to properly handle this and other cases.
This was followed by https://reviews.llvm.org/D138148 (open) & https://reviews.llvm.org/D137244 (merged). In the latter, @cor3ntin notes:
Either way, I think this makes support for P0588 complete, but we probably want to add a test for that in a separate PR.
(and I lack confidence I understand P0588 sufficiently to assert the completeness of our conformance).