This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Moves unwrap_reference to type_traits.
ClosedPublic

Authored by Mordante on Apr 27 2023, 8:16 AM.

Details

Reviewers
philnik
Group Reviewers
Restricted Project
Commits
rGb7932803dede: [libc++] Moves unwrap_reference to type_traits.
Summary

This was discovered while working on modules.

Diff Detail

Event Timeline

Mordante created this revision.Apr 27 2023, 8:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2023, 8:16 AM
Herald added a subscriber: arichardson. · View Herald Transcript
Mordante requested review of this revision.Apr 27 2023, 8:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2023, 8:16 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Mordante updated this revision to Diff 517576.Apr 27 2023, 8:25 AM

Fixes CI.

philnik added inline comments.
libcxx/include/__functional/unwrap_ref.h
24

At least according to cppreference, unwrap_ref_decay should also get defined by <type_traits>.

libcxx/include/__type_traits/unwrap_ref.h
25

What's wrong with forward-declaring reference_wrapper here?

Mordante updated this revision to Diff 517614.Apr 27 2023, 9:48 AM

CI fixes.

Mordante updated this revision to Diff 517625.Apr 27 2023, 10:07 AM

Trigger CI.

Mordante updated this revision to Diff 520167.May 7 2023, 5:12 AM

Addresses review comment. Basically the patch is now a rename.

Mordante updated this revision to Diff 520168.May 7 2023, 5:20 AM

CI fixes.

philnik added inline comments.May 7 2023, 12:28 PM
libcxx/include/__type_traits/unwrap_ref.h
45

Maybe make this _LIBCPP_STD_VER >= 20 while you're at it?

libcxx/include/module.modulemap.in
980–981

IMO we should only export the actually required parts, not all of type_traits.

Mordante marked 4 inline comments as done.May 13 2023, 2:34 AM

Thanks for the review!

libcxx/include/module.modulemap.in
980–981

That indeed seems to work too, in the past this didn't always work, not sure why.

Mordante updated this revision to Diff 521887.May 13 2023, 2:36 AM
Mordante marked an inline comment as done.

Addresses review comments.

philnik accepted this revision.May 13 2023, 7:14 AM

LGTM!

This revision is now accepted and ready to land.May 13 2023, 7:14 AM
Mordante updated this revision to Diff 521904.May 13 2023, 8:15 AM

Rebased and resolved merge conflicts.

This revision was automatically updated to reflect the committed changes.