This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Rename __identity to __type_identity
ClosedPublic

Authored by philnik on Mar 18 2022, 9:54 AM.

Details

Reviewers
ldionne
Mordante
Group Reviewers
Restricted Project
Commits
rG3c6bd176fb89: [libc++] Rename __identity to __type_identity
Summary

In C++20 the type trait type_identity was introduced. For the same purpose there is __identity for pre-C++20 code. The name is confusing, because since C++20 there is also identity, which isn't a type trait.

Diff Detail

Event Timeline

philnik created this revision.Mar 18 2022, 9:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 18 2022, 9:54 AM
philnik requested review of this revision.Mar 18 2022, 9:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 18 2022, 9:54 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Mordante accepted this revision as: Mordante.Mar 19 2022, 10:48 AM

Nice catch! LGTM!

libcxx/include/type_traits
1335

I'm a bit puzzled why this is the only one using _LIBCPP_NODEBUG. @ldionne do you know whether this inconsistency is intended.
Note When we fix it, I prefer a separate patch.

ldionne accepted this revision.Mar 24 2022, 4:09 PM
ldionne added a subscriber: EricWF.

Thanks a lot, good catch indeed.

libcxx/include/type_traits
1335

We do use _LIBCPP_NODEBUG in a couple of other places. I think we only use it for internal-only typedefs, so this one looks fine to me. @EricWF could probably give more background on the intent behind this macro.

This revision is now accepted and ready to land.Mar 24 2022, 4:09 PM
This revision was automatically updated to reflect the committed changes.