mirror of
https://github.com/siemens-mobile-hacks/llvm-c166.git
synced 2026-11-28 11:52:25 +00:00
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]`.
10 lines
236 B
C++
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
|
|
}
|