This is an archive of the discontinued LLVM Phabricator instance.

GH60642: Fix ICE when checking a lambda defined in a concept definition
AbandonedPublic

Authored by erichkeane on Feb 16 2023, 7:54 AM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Commits
rG4bf6cc63aa77: GH60642: Fix ICE when checking a lambda defined in a concept definition
Summary

As reported in GH60642, we asserted when there was a lambda defined in a
template arguments inside of a concept, which caused us to not properly
set up the list of instantiation args. This patch ensures that the
'lambda context decl' correctly falls-through the template argument
instantiation, so that it is available when instantiating the lambda,
and thus, when setting up the lambda instantiation args list.

Diff Detail

Event Timeline

erichkeane created this revision.Feb 16 2023, 7:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 16 2023, 7:54 AM
erichkeane requested review of this revision.Feb 16 2023, 7:54 AM

I don't really need reviewers here, I'm more putting this on phab to get the libcxx testing, once that succeeds, i intend to do this as Review-after-commit if there are no concerns (and also ask for this to go to 16.0, as it is a regression).

shafik added a subscriber: shafik.Feb 16 2023, 2:19 PM
shafik added inline comments.
clang/lib/Sema/TreeTransform.h
4572

Not for this PR but I am looking at other place we use EnterExpressionEvaluationContext and it is not obvious to me when we should be using Sema::ReuseLambdaContextDecl or not. So might be worth looking at other uses as well.

erichkeane added inline comments.Feb 16 2023, 2:29 PM
clang/lib/Sema/TreeTransform.h
4572

Yeah, its unfortunately not particularly clear to me either. We should be re-using that context any time we're going "down" in code (that is, if we are potentially in a context where a lambda is defined inside of something its actual declcontext doesn't match), but should NOT reuse the context in a case where we are 'swapping' contexts to do something like instantiate a function required by the current context/etc.

erichkeane abandoned this revision.Feb 17 2023, 6:10 AM

Looks like I have ot abandon this now? Anyway, fix was committed, but I forgot the differential-revision line.

Looks like I have ot abandon this now? Anyway, fix was committed, but I forgot the differential-revision line.

You can also Close the revision instead of abandoning it to make it obvious that it has been landed.

Looks like I have ot abandon this now? Anyway, fix was committed, but I forgot the differential-revision line.

You can also Close the revision instead of abandoning it to make it obvious that it has been landed.

I didn't actually have that option in the "Add Action" section? I was looking for it, but it seems to have disappeared?

Looks like I have ot abandon this now? Anyway, fix was committed, but I forgot the differential-revision line.

You can also Close the revision instead of abandoning it to make it obvious that it has been landed.

I didn't actually have that option in the "Add Action" section? I was looking for it, but it seems to have disappeared?

I have it on my open revisions, maybe you just missed it?

Looks like I have ot abandon this now? Anyway, fix was committed, but I forgot the differential-revision line.

You can also Close the revision instead of abandoning it to make it obvious that it has been landed.

I didn't actually have that option in the "Add Action" section? I was looking for it, but it seems to have disappeared?

I have it on my open revisions, maybe you just missed it?

This is what I have for options on my open revisions (I went and grabbed a snap from a different review): https://imgur.com/a/WYD3uAV

So I don't see 'close' as an option?

Looks like I have ot abandon this now? Anyway, fix was committed, but I forgot the differential-revision line.

You can also Close the revision instead of abandoning it to make it obvious that it has been landed.

I didn't actually have that option in the "Add Action" section? I was looking for it, but it seems to have disappeared?

I have it on my open revisions, maybe you just missed it?

This is what I have for options on my open revisions (I went and grabbed a snap from a different review): https://imgur.com/a/WYD3uAV

So I don't see 'close' as an option?

Weird. I see a few more options: