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.
Details
- Reviewers
- None
- Group Reviewers
Restricted Project - Commits
- rG4bf6cc63aa77: GH60642: Fix ICE when checking a lambda defined in a concept definition
Diff Detail
Event Timeline
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).
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. |
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. |
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?
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?
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.