[libcxx-commits] [PATCH] D92212: Make libcxx work according to Clang C++ Status if -fchar8_t is passed

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Dec 2 14:26:32 PST 2020


ldionne added a comment.

In D92212#2428337 <https://reviews.llvm.org/D92212#2428337>, @mclow.lists wrote:

> I think this is the wrong direction - getting rid of `_LIBCPP_NO_HAS_CHAR8_T`
> We're making the feature macro `__cpp_lib_char8_t` always match `__cpp_char8_t`
> There are two macros for a reason.

Just to make sure I understand, your preference would be this, right? Please correct me if I'm wrong:

  #if _LIBCPP_STD_VER > 17 && defined(__cpp_char8_t)
  #  define __cpp_lib_char8_t
  #endif

In other words, define the library parts of `char8_t` only when the standard is >= C++20 *and* the compiler supports `char8_t`. Is that correct? That would basically be the status quo.

Like I said above, I do agree strongly that we shouldn't try to enable C++20 features in C++17, however in this case the compiler has already decided to make this possible (by providing `-fchar8_t` that can be enabled in C++17 mode), for compatibility reasons documented in the paper. In this instance, I believe that it's worse to have the library be inconsistent with the compiler than to digress from the design principle of not backporting stuff. Thoughts?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92212/new/

https://reviews.llvm.org/D92212



More information about the libcxx-commits mailing list