Skip to content

Clang C++20 Feature: P0588R1 - Simplifying implicit lambda capture #61426

Open
@h-vetinari

Description

@h-vetinari

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:

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).

Footnotes

  1. It's obviously questionable to call this a "C++20 Feature", but I'm following the pattern of the other paper-tracking issues.

  2. curiously, GH search found nothing for "P0588", but did find something for "P0588R1"

Metadata

Metadata

Assignees

Labels

c++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"defect reportIssues representing WG21 papers to be applied as a defect reportlambdaC++11 lambda expressions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions