This is an archive of the discontinued LLVM Phabricator instance.

[C++20] Mark lambdas in lambda specifiers as dependent if necessary
AbandonedPublic

Authored by lime on Dec 23 2022, 1:13 AM.

Details

Reviewers
cor3ntin
shafik
erichkeane
aaron.ballman
ychen
Group Reviewers
Restricted Project
Summary

Lambdas in lambda specifiers should be dependent if they appear in a generic
lambda, while current lambda creating processes fail to specify the correct
dependency kind to them.

This patch adds a template parameter scope before parsing lambda specifiers and
fixes issues:
https://github.com/llvm/llvm-project/issues/57155
https://github.com/llvm/llvm-project/issues/57170

Diff Detail

Event Timeline

lime created this revision.Dec 23 2022, 1:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 23 2022, 1:13 AM
lime requested review of this revision.Dec 23 2022, 1:13 AM
lime added a comment.Dec 23 2022, 3:53 AM

I submitted it a little early. The correct fix may be letting the declaration be dependent.

lime updated this revision to Diff 485276.Dec 26 2022, 2:36 AM
lime retitled this revision from [C++20] Check the dependency of declaration contexts before pumping diagnostics to [C++20] Mark lambdas in lambda specifiers as dependent if necessary.
lime edited the summary of this revision. (Show Details)
lime edited the summary of this revision. (Show Details)Dec 26 2022, 6:24 AM
lime added a comment.Dec 26 2022, 10:59 PM

There should be a more general solution. This patch does not solve the issue here.

cor3ntin added inline comments.Feb 2 2023, 12:47 AM
clang/test/SemaCXX/lambda-unevaluated.cpp
127

I thought unevaluated lambdas could not have captures. that might be the issue here

shafik added inline comments.Feb 2 2023, 8:07 AM
clang/test/SemaCXX/lambda-unevaluated.cpp
127

P0315 and says it should be allowed.

lime added a comment.Feb 12 2023, 6:26 AM

Crashes were gone although via avoiding diagnostics directly in D140838. Considering this does not fix the acceptance of the ill code here, should I abandon this patch?

lime abandoned this revision.Feb 27 2023, 6:06 AM