llvm-c166/lldb/test/API/lang/cpp/char8_t/main.cpp
Nerixyz 605feeda1e
[lldb] Trim and show embedded zeros in charN_t arrays (#195514)
When formatting `char[N]` (N > 0), the read buffer is limited to the
array size and trailing zeros are trimmed.

`charN_t[N]` was treated like a `charN_t *` and the formatter read until
the first zero byte.
If the array doesn't have any zero bytes in it, this will read too much.
If the array has zero bytes in it, it will show too little.

With this PR, `wchar_t[N]` and `charN_t[N]` are printed like `char[N]`.
2026-05-07 12:15:16 +02:00

10 lines
236 B
C++

char8_t a = u8'a';
const char8_t* ab = u8"你好";
char8_t abc[9] = u8"你好";
char8_t aZero[32] = u8"I\0have\0zeros";
const char8_t *cZero = u8"I\0have\0zeros";
int main (int argc, char const *argv[]) {
return 0; // break here
}