This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Realize generic lambda call operators are dependent sooner
ClosedPublic

Authored by cor3ntin on Sep 1 2023, 7:00 AM.

Details

Summary

When parsing a trailing return type / noexcept / constraint
of a generic lambda, we need to know that we are in a dependent
context. We currently don't because we only create a TemplateDecl
for the call operator one its fully parsed.

This patch attach a template decl to the call operator as soon
as the parameter declaration clause is parsed - the point at which
we have collected all template parameters

Fixes #64689

Diff Detail

Event Timeline

cor3ntin created this revision.Sep 1 2023, 7:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 1 2023, 7:00 AM
cor3ntin requested review of this revision.Sep 1 2023, 7:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 1 2023, 7:00 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
erichkeane accepted this revision.Sep 1 2023, 7:20 AM

This is great! Probably worth the cherry pick to Clang17 as well!

This revision is now accepted and ready to land.Sep 1 2023, 7:20 AM
cor3ntin updated this revision to Diff 555375.Sep 1 2023, 7:50 AM

Fix tests

This revision was landed with ongoing or failed builds.Sep 1 2023, 11:06 PM
This revision was automatically updated to reflect the committed changes.