| Issue |
97601
|
| Summary |
[libc++] No library support for `char8_t` if compiled without C++20 but with `-fchar8_t`
|
| Labels |
libc++
|
| Assignees |
|
| Reporter |
MitalAshok
|
Currently, `_LIBCPP_HAS_NO_CHAR8_T` is always defined if not compiled with `-std=c++20` or above:
https://github.com/llvm/llvm-project/blob/3ab2247d10673419609333a33bca0eca8a56bf3d/libcxx/include/__config#L702-L704
But both Clang and GCC allow `char8_t` in older standards with the `-fchar8_t` flag: https://godbolt.org/z/ePcrqvWsa
Someone specifying `-fchar8_t` presumably is going to use `char8_t` consistently even before C++20, so it makes sense to allow using library facilities for `char8_t`. One problem I can think of is that some names (like `u8string`) aren't reserved in C++17, but someone using `-fchar8_t` should know not to use them. Plus libstdc++ supports it.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs