Skip to content

Commit dada605

Browse files
author
VemundH
committed
Fix test build in C++20
1 parent 1376eb0 commit dada605

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_builtin_casters.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ TEST_SUBMODULE(builtin_casters, m) {
3030
else { wstr.push_back((wchar_t) mathbfA32); } // 𝐀, utf32
3131
wstr.push_back(0x7a); // z
3232

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‽ 🎂 𝐀
3434
m.def("good_utf16_string", [=]() { return std::u16string({ b16, ib16, cake16_1, cake16_2, mathbfA16_1, mathbfA16_2, z16 }); }); // b‽🎂𝐀z
3535
m.def("good_utf32_string", [=]() { return std::u32string({ a32, mathbfA32, cake32, ib32, z32 }); }); // a𝐀🎂‽z
3636
m.def("good_wchar_string", [=]() { return wstr; }); // a‽𝐀z
@@ -69,7 +69,7 @@ TEST_SUBMODULE(builtin_casters, m) {
6969
m.def("string_view_chars", [](std::string_view s) { py::list l; for (auto c : s) l.append((std::uint8_t) c); return l; });
7070
m.def("string_view16_chars", [](std::u16string_view s) { py::list l; for (auto c : s) l.append((int) c); return l; });
7171
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"); });
7373
m.def("string_view16_return", []() { return std::u16string_view(u"utf16 secret \U0001f382"); });
7474
m.def("string_view32_return", []() { return std::u32string_view(U"utf32 secret \U0001f382"); });
7575
#endif

0 commit comments

Comments
 (0)