[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 02:15:14 PST 2020


georgthegreat added a comment.

@ldionne, this PR appeared as a part of a large monorepo migration to a new standard.
If I just change -std=c++17 to -std=c++20, thousands of new errors appear (even upon switching off all the major deprecation warnings), so I am trying to split the switch into smaller parts and fix them one by one.
New standard changes behavior of u8"" literals in an incompatible way, so I have to remove these literals from the codebase and prevent new `std::string = u8"blah"` lines from appearance.

So, I am going to apply this change to a local copy of libcxx, no matter if this diff will land into upstream. I just can not think of any other solution. Switching entire codebase in one commit is not an available option.

Now, to the changes itself.
I think that WG21 invented feature testing macros for a reason.
At the time checking _LIBCPP_STD_VER just does not work, because it corresponds to a different set of features, depending on which compiler is used (i. e. clang12 will implement more of C++20 compared to clang11).
IMO, an ideal implementation must not check _LIBCPP_STD_VER, but rather check if a specific feature is available and enabled in the current compiler, **no matter how it was switched on**.


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