This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Replace _LIBCPP_HAS_NO_CONCEPTS with _LIBCPP_STD_VER > 17. NFCI.
ClosedPublic

Authored by jloser on Mar 12 2022, 8:58 AM.

Details

Summary

All supported compilers that support C++20 now support concepts. So, remove
_LIB_LIBCPP_HAS_NO_CONCEPTS in favor of _LIBCPP_STD_VER > 17. Similarly in
the tests, remove // UNSUPPORTED: libcpp-no-concepts.

Note that some #if seem to be incorrect prior to this change for some result
types in __algorithm. They are self-inconsistent of whether to guard on
concepts, ranges, etc.

Diff Detail

Event Timeline

jloser created this revision.Mar 12 2022, 8:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 12 2022, 8:58 AM
Herald added a subscriber: arichardson. · View Herald Transcript
jloser requested review of this revision.Mar 12 2022, 8:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 12 2022, 8:58 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
jloser updated this revision to Diff 414854.Mar 12 2022, 8:59 AM
jloser retitled this revision from [libcxx] Replace _LIBCPP_HAS_NO_CONCEPTS with _LIBCPP_STD_VER > 17. NFCI. to [libc++] Replace _LIBCPP_HAS_NO_CONCEPTS with _LIBCPP_STD_VER > 17. NFCI..

Use libc++ in title and not libcxx so CI will run

jloser updated this revision to Diff 414862.Mar 12 2022, 10:18 AM

Add back // UNSUPPORTED: libcpp-has-no-incomplete-ranges to range_concept_conformance.compile.pass

Mordante accepted this revision as: Mordante.Mar 12 2022, 10:29 AM

Thanks a lot for working on this! Only some small requests and please fix the CI. Otherwise LGTM!

libcxx/include/span
184

Pre-existing: Can you add a comment here?

libcxx/include/string_view
325

Pre-existing: Can you add a comment here?

libcxx/test/std/containers/views/range_concept_conformance.compile.pass.cpp
11

This test fails this should probably remain // UNSUPPORTED: libcpp-has-no-incomplete-ranges.

jloser updated this revision to Diff 414863.Mar 12 2022, 10:35 AM

Address review feedback by adding comments for #endif in string_view and span

jloser marked 3 inline comments as done.Mar 12 2022, 10:35 AM
jloser added inline comments.
libcxx/test/std/containers/views/range_concept_conformance.compile.pass.cpp
11

Yep, I pushed a fix for this while you were in the middle of the review. This should fix CI. :)

philnik accepted this revision.Mar 13 2022, 5:07 AM

LGTM % nits! Regarding the result types, I change that in D121435.

libcxx/include/__iterator/reverse_iterator.h
195

Could you add the comment here too?

libcxx/include/__utility/cmp.h
104

Also here

libcxx/include/string_view
738

And here

This revision is now accepted and ready to land.Mar 13 2022, 5:07 AM
jloser marked 4 inline comments as done.Mar 13 2022, 9:37 AM