This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Make __decay_copy constexpr
ClosedPublic

Authored by ldionne on Oct 27 2021, 12:13 PM.

Details

Reviewers
Mordante
Quuxplusone
Group Reviewers
Restricted Project
Commits
rG2999b7307f70: [libc++] Make __decay_copy constexpr
Summary

This is going to be necessary to implement some range adaptors.
As a fly-by fix, rename _LIBCPP_INLINE_VISIBILITY to _LIBCPP_HIDE_FROM_ABI
and remove a redundant inline keyword.

Diff Detail

Event Timeline

ldionne requested review of this revision.Oct 27 2021, 12:13 PM
ldionne created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2021, 12:13 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
jloser added a subscriber: jloser.Oct 27 2021, 12:35 PM
jloser added inline comments.
libcxx/include/__utility/decay_copy.h
25

I'm assuming this is used in C++11 code (thread and future) which is why we spell typename decay<_Tp>::type instead of decay_t<_Tp>?

27

Nit: pre-existing, but can we remove the extra space to cuddle the >>, please?

Mordante accepted this revision as: Mordante.Oct 27 2021, 12:51 PM
Mordante added a subscriber: Mordante.

LGTM!

libcxx/include/__utility/decay_copy.h
27

Just FYI this is due to clang-tidy still being used in C++03 mode. We can change the clang-tidy language standard after switching to clang-tidy-13. (I expect make a patch for it real soon.)

jloser added inline comments.Oct 27 2021, 12:54 PM
libcxx/include/__utility/decay_copy.h
27

Thanks for the context. I'd definitely be in favor of that change. :)

jloser added inline comments.Oct 27 2021, 12:57 PM
libcxx/include/__utility/decay_copy.h
27

Is clang-tidy even run on libc++ CI? It's mentioned in libcxx/TODO.TXT to run clang-tidy on libc++. I notice that most llvm projects have their own .clang-tidy file, but libc++ does not.

Quuxplusone accepted this revision.Oct 27 2021, 1:20 PM
Quuxplusone added a subscriber: Quuxplusone.
Quuxplusone added inline comments.
libcxx/include/__utility/decay_copy.h
27

Typo for clang-format, I assume. :) +1 for cuddling >>.

This revision is now accepted and ready to land.Oct 27 2021, 1:20 PM
Mordante added inline comments.Oct 27 2021, 1:23 PM
libcxx/include/__utility/decay_copy.h
27

Note to self, don't read about clang-tidy while writing about clang-format ;-)

ldionne marked 5 inline comments as done.Oct 27 2021, 2:31 PM

Thanks for the reviews everyone, I'll ship with the applied comments.

libcxx/include/__utility/decay_copy.h
25

Yes!

This revision was automatically updated to reflect the committed changes.
ldionne marked an inline comment as done.