This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Assume that compilers support extended constexpr in C++14 mode
ClosedPublic

Authored by ldionne on Aug 24 2021, 8:59 AM.

Details

Summary

We don't support any compiler that doesn't support C++14 constexpr when
compiling in C++14 mode anymore, so we can just assume that we have C++14
extended constexpr when compiling in C++14 mode. This allows us to remove
some workarounds for older compilers.

Diff Detail

Event Timeline

ldionne requested review of this revision.Aug 24 2021, 8:59 AM
ldionne created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2021, 9:00 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne updated this revision to Diff 368409.Aug 24 2021, 11:10 AM

Fix issues with wrap_iter constexpr in C++11 and C++03 mode

Quuxplusone added a subscriber: Quuxplusone.

LGTM % if there's anything to do about my comment.

libcxx/include/__config
565–567

Should this number be bumped upward? Or does _MSC_VER==1900 actually support C++14 constexpr, and we just didn't notice it until now?

IIUC, this is a "major NFC" change ;) — we used to never use C++14 constexpr on _LIBCPP_COMPILER_MSVC, and now we're going to always use it. Right? (Not a "problem" per se, but noteworthy.)

ldionne added inline comments.
libcxx/include/__config
565–567

@mstorsjo Do you know what's the status of our support on MSVC? Officially, we don't support it, but does it actually work even a bit?

ldionne updated this revision to Diff 368430.Aug 24 2021, 12:40 PM

Fix embarrassingly obvious logic error in _LIBCPP_CONSTEXPR_IF_NODEBUG

mstorsjo added inline comments.Aug 24 2021, 12:44 PM
libcxx/include/__config
565–567

I remember seeing a mention somewhere, that the biggest blocker is that MSVC doesn't support #include_next, which pretty much blocks it from even trying to use our headers.

In this case, the MSVC version number here corresponds to the version of MSVC that clang-cl impersonates, and also implying what version of the MSVC runtime is being used.

ldionne accepted this revision.Aug 25 2021, 5:40 AM
This revision is now accepted and ready to land.Aug 25 2021, 5:40 AM