@@ -30,7 +30,7 @@ TEST_SUBMODULE(builtin_casters, m) {
30
30
else { wstr.push_back ((wchar_t ) mathbfA32); } // 𝐀, utf32
31
31
wstr.push_back (0x7a ); // z
32
32
33
- m.def (" good_utf8_string" , []() { return std::string (u8" Say utf8\u203d \U0001f382 \U0001d400 " ); }); // Say utf8‽ 🎂 𝐀
33
+ m.def (" good_utf8_string" , []() { return std::string (( const char *) u8" Say utf8\u203d \U0001f382 \U0001d400 " ); }); // Say utf8‽ 🎂 𝐀
34
34
m.def (" good_utf16_string" , [=]() { return std::u16string ({ b16, ib16, cake16_1, cake16_2, mathbfA16_1, mathbfA16_2, z16 }); }); // b‽🎂𝐀z
35
35
m.def (" good_utf32_string" , [=]() { return std::u32string ({ a32, mathbfA32, cake32, ib32, z32 }); }); // a𝐀🎂‽z
36
36
m.def (" good_wchar_string" , [=]() { return wstr; }); // a‽𝐀z
@@ -69,7 +69,7 @@ TEST_SUBMODULE(builtin_casters, m) {
69
69
m.def (" string_view_chars" , [](std::string_view s) { py::list l; for (auto c : s) l.append ((std::uint8_t ) c); return l; });
70
70
m.def (" string_view16_chars" , [](std::u16string_view s) { py::list l; for (auto c : s) l.append ((int ) c); return l; });
71
71
m.def (" string_view32_chars" , [](std::u32string_view s) { py::list l; for (auto c : s) l.append ((int ) c); return l; });
72
- m.def (" string_view_return" , []() { return std::string_view (u8" utf8 secret \U0001f382 " ); });
72
+ m.def (" string_view_return" , []() { return std::string_view (( const char *) u8" utf8 secret \U0001f382 " ); });
73
73
m.def (" string_view16_return" , []() { return std::u16string_view (u" utf16 secret \U0001f382 " ); });
74
74
m.def (" string_view32_return" , []() { return std::u32string_view (U" utf32 secret \U0001f382 " ); });
75
75
#endif
0 commit comments