This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Improve LIBCXX_ENABLE_INCOMPLETE_FEATURES.
ClosedPublic

Authored by Mordante on Jul 30 2021, 12:18 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rGd618a1cc5c39: [libc++] Improve LIBCXX_ENABLE_INCOMPLETE_FEATURES.
Summary

@tcanens pointed out the current behavior of the macro breaks the usage
pattern described in http://wg21.link/SD6

#  if __has_include(<optional>)
#    include <optional>
#    if __cpp_lib_optional >= 201606
#      define have_optional 1
#    endif

To support this usage pattern the hard errror is removed. Instead the
header includes nothing but the <version> header.

Diff Detail

Event Timeline

Mordante requested review of this revision.Jul 30 2021, 12:18 AM
Mordante created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJul 30 2021, 12:18 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne accepted this revision.Jul 30 2021, 6:41 AM

LGTM despite the flaky test. I'll cherry-pick this onto LLVM 13. Thanks!

This revision is now accepted and ready to land.Jul 30 2021, 6:41 AM
This revision was landed with ongoing or failed builds.Jul 30 2021, 11:36 AM
This revision was automatically updated to reflect the committed changes.

@tstellar I'd like to cherry-pick this to release/13.x. This is a small change that will improve the usability of the library a lot in the release.

Thanks @tstellar. As discussed with @ldionne I cherry-picked the commit on release/13.x.