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

Yuriy Chernyshov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Nov 28 04:03:16 PST 2020


georgthegreat added a comment.

Found the official explanation and motivation <https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations> regarding the feature testing macros.

It lacks a proper distinction between compiler and standard library, simply using term //Implementers//. However, as I understand it:

C++ compiler defines (via some internal mechanism, invisible in the code being compiled) `__cpp_char8_t`, if corresponding proposal is supported (that is, if char8_t is available, is a distinct type and so on).
C++ standard library defines `__cpp_lib_char8_t` if it implements the library part of the corresponding proposal (that is, if `std::u8string{,_view}` typedefs are available). `__cpp_lib_char8_t` **requires** `_cpp_char8_t` to be defined.
C++ programmer must check the availability of `u8string_view` by checking `__cpp_lib_char8_t`, not by checking the standard version.


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