This is an archive of the discontinued LLVM Phabricator instance.

[libc++] [NFC] s/_LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)/!defined(_LIBCPP_HAS_NO_CONCEPTS)/
ClosedPublic

Authored by Quuxplusone on Feb 1 2022, 5:02 PM.

Details

Summary

Per Discord discussion, we're normalizing on a simple !defined(_LIBCPP_HAS_NO_CONCEPTS) so that we can do a big search-and-replace for !defined(_LIBCPP_HAS_NO_CONCEPTS) back into _LIBCPP_STD_VER > 17 when we're ready to abandon support for concept-syntax-less compilers.

If CI is happy with this, imma push it. (EDIT: no I won't, we'll wait for tomorrow)

Diff Detail

Event Timeline

Quuxplusone requested review of this revision.Feb 1 2022, 5:02 PM
Quuxplusone created this revision.
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald TranscriptFeb 1 2022, 5:02 PM
jloser accepted this revision.Feb 1 2022, 5:18 PM
jloser added a subscriber: jloser.
jloser added inline comments.
libcxx/include/ranges
242

No action required, but this seems like a weird guard for !defined(_LIBCPP_HAS_NO_CONCEPTS). I would have expected the macro used to be something about ranges...

Quuxplusone edited the summary of this revision. (Show Details)Feb 1 2022, 5:25 PM
Quuxplusone added inline comments.
libcxx/include/ranges
242

Huh, good point. I have no idea... oh wait, yes I do. 😛 I bet that every single detail header that involves a view type is guarded by !defined(_LIBCPP_HAS_NO_CONCEPTS), because the view types all require some concept or other. Therefore, when _LIBCPP_HAS_NO_CONCEPTS, all of those headers sublimate away, which means nobody ever gets around to defining namespace views { ... }, which means line 244 failed to compile, and nobody ever looked into it. 😛We could certainly fix this via

namespace ranges::views { }
namespace views = ranges::views;

but I'm not sure I care enough.

ldionne accepted this revision.Feb 2 2022, 7:46 AM
ldionne added a subscriber: ldionne.

LGTM, please ship this and then cherry-pick it onto release/14.x:

git checkout release/14.x
git cherry-pick -x <SHA>
git push
libcxx/include/ranges
242

I think guarding this is correct. That way, when we move to _LIBCPP_STD_VER > 17, this will be guarded the way we want it.

This revision is now accepted and ready to land.Feb 2 2022, 7:46 AM
Quuxplusone added inline comments.Feb 2 2022, 9:37 AM
libcxx/include/ranges
242

This is now D118809.