[libcxx-commits] [PATCH] D91517: [libc++] [P0482] [C++20] Implement missing bits for codecvt and codecvt_byname.

Marek Kurdej via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 17 03:56:07 PST 2020


curdeius added a comment.

Buildkite shows build failures with undefined references.
That's because libc++ (.so, .a) is compiled using -std=c++17 and I used `#ifndef _LIBCPP_NO_HAS_CHAR8_T` to guard the char8_t-related things.

`_LIBCPP_NO_HAS_CHAR8_T` is defined as:

  #if _LIBCPP_STD_VER <= 17 || !defined(__cpp_char8_t)
  #define _LIBCPP_NO_HAS_CHAR8_T
  #endif

So, in the failing cases, `src/` compiles with C++17 and so without char8_t, but `include/` and `test/` compile with C++20.

I haven't seen these failures locally before because I was compiling everything in C++20 mode (`CXX_STANDARD 20` in `libcxx/CMakeLists.txt`).

I see 2 possible solutions:

1. Use `CXX_STANDARD 20`, but it might be an overkill.
2. Change guards in `locale.cpp` to just `#ifdef __cpp_char8_t` instead of `#ifndef _LIBCPP_NO_HAS_CHAR8_T`.

WDYT?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91517



More information about the libcxx-commits mailing list