This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Correctly handle generic lambda used as default template argument.
ClosedPublic

Authored by cor3ntin on May 24 2023, 9:14 AM.

Details

Summary

Adjust the template pparameter depth when parsing default
template arguments as they may introduce generic lambda whose parameters
are not substituted at the same depth.

Fixes #62611

Diff Detail

Event Timeline

cor3ntin created this revision.May 24 2023, 9:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2023, 9:14 AM
cor3ntin requested review of this revision.May 24 2023, 9:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2023, 9:14 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
erichkeane accepted this revision.May 24 2023, 9:59 AM
erichkeane added a reviewer: Restricted Project.

So I think this is the right approach here. Unfortunately my knowledge of the parser is a little wonky, so I don't feel comfortable JUST approving this right away(though it DOES look correct to me). I'd like to give other folks a day or two to take a look. I've added the lang-wg, so please give them a day or two to point out why I'm an idiot here before committing this.

clang/lib/Parse/ParseTemplate.cpp
850

Same below.

This revision is now accepted and ready to land.May 24 2023, 10:00 AM
cor3ntin updated this revision to Diff 526034.May 26 2023, 5:44 AM

Address Erich's feedback.