This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Allow omitting `typename` in befriended constructors parameters
ClosedPublic

Authored by cor3ntin on Jun 6 2023, 12:27 AM.

Details

Summary

Fixes #63119

Diff Detail

Event Timeline

cor3ntin created this revision.Jun 6 2023, 12:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2023, 12:27 AM
cor3ntin requested review of this revision.Jun 6 2023, 12:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2023, 12:27 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
cor3ntin added a reviewer: Restricted Project.Jun 6 2023, 12:28 AM

In the patch summary: consstructors -> constructors

Can you also add a test case to cover "unless that parameter-declaration appears in a default argument" from http://eel.is/c++draft/temp.res#general-4.3.3 ?

cor3ntin updated this revision to Diff 528811.Jun 6 2023, 5:33 AM

Add test for default parameters

cor3ntin retitled this revision from [Clang] Allow omitting `typename` in befriended consstructors parameters to [Clang] Allow omitting `typename` in befriended constructors parameters.Jun 6 2023, 5:33 AM
aaron.ballman added inline comments.Jun 6 2023, 5:37 AM
clang/test/CXX/temp/temp.res/p4.cpp
182–183

Hmmm, I was expecting a missing 'typename' test case, so perhaps add a friend declaration that's a definition instead?

cor3ntin added inline comments.Jun 6 2023, 5:40 AM
clang/test/CXX/temp/temp.res/p4.cpp
182–183

that is not possible for a constructor afaik

aaron.ballman accepted this revision.Jun 6 2023, 5:41 AM

LGTM!

clang/test/CXX/temp/temp.res/p4.cpp
182–183

Oh shoot, that's a good point. Nevermiiiiiiind. :-)

This revision is now accepted and ready to land.Jun 6 2023, 5:41 AM
This revision was landed with ongoing or failed builds.Jun 6 2023, 6:05 AM
This revision was automatically updated to reflect the committed changes.