[clang] [libcxx] [llvm] [Clang] Add warnings when mixing different charN_t types (PR #138708)
via cfe-commits
cfe-commits at lists.llvm.org
Wed May 14 14:41:44 PDT 2025
================
@@ -484,7 +484,7 @@ template <class InternT, class ExternT>
void utf8_to_utf16_in_ok(const std::codecvt<InternT, ExternT, mbstate_t>& cvt) {
// UTF-8 string of 1-byte CP, 2-byte CP, 3-byte CP and 4-byte CP
const unsigned char input[] = "b\u0448\uAAAA\U0010AAAA";
- const char16_t expected[] = {'b', 0x0448, 0xAAAA, 0xDBEA, 0xDEAA, 0};
+ const InternT expected[] = {0x62, 0x0448, 0xAAAA, 0xDBEA, 0xDEAA, 0};
static_assert(array_size(input) == 11, "");
static_assert(array_size(expected) == 6, "");
----------------
EricWF wrote:
Github won't let you leave comments on lines outside of the change context,
but I don't understand why the test declares two copies of the expected data, the const one above, and the one it uses below, if it wasn't the intention to test this sort of type mismatch.
It seems to me the test is saying "I expect to be able to copy between these two types"
https://github.com/llvm/llvm-project/pull/138708
More information about the cfe-commits
mailing list