diff --git a/ChangeLog.md b/ChangeLog.md index c38e5207ea6f1..649ed9e0b344e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -26,6 +26,10 @@ See docs/process.md for more on how version tagging works. - Emscripten-generated code will now use async/await internally when loading the Wasm module. This will be lowered away by babel when targeting older browsers. (#23068) +- Due to the discontinued support for invalid specializations of +- `std::basic_string` (https://github.com/llvm/llvm-project/pull/72694), the + support for `std::basic_string` was removed from embind. + (#23070) 3.1.73 - 11/28/24 ----------------- diff --git a/src/embind/embind.js b/src/embind/embind.js index 64b6fd437d36a..941d9cf54d366 100644 --- a/src/embind/embind.js +++ b/src/embind/embind.js @@ -496,8 +496,7 @@ var LibraryEmbind = { name = readLatin1String(name); var stdStringIsUTF8 #if EMBIND_STD_STRING_IS_UTF8 - //process only std::string bindings with UTF8 support, in contrast to e.g. std::basic_string - = (name === "std::string"); + = true; #else = false; #endif diff --git a/system/lib/embind/bind.cpp b/system/lib/embind/bind.cpp index e7f17c64631b7..fa32bd173ca4f 100644 --- a/system/lib/embind/bind.cpp +++ b/system/lib/embind/bind.cpp @@ -149,8 +149,6 @@ EMSCRIPTEN_BINDINGS(builtin) { register_float("double"); _embind_register_std_string(TypeID::get(), "std::string"); - _embind_register_std_string( - TypeID>::get(), "std::basic_string"); _embind_register_std_wstring(TypeID::get(), sizeof(wchar_t), "std::wstring"); _embind_register_std_wstring(TypeID::get(), sizeof(char16_t), "std::u16string"); _embind_register_std_wstring(TypeID::get(), sizeof(char32_t), "std::u32string"); diff --git a/test/code_size/embind_hello_wasm.json b/test/code_size/embind_hello_wasm.json index f3b1d73bc6bec..9d622aa122fca 100644 --- a/test/code_size/embind_hello_wasm.json +++ b/test/code_size/embind_hello_wasm.json @@ -1,10 +1,10 @@ { "a.html": 552, "a.html.gz": 380, - "a.js": 9718, - "a.js.gz": 4291, - "a.wasm": 7728, - "a.wasm.gz": 3502, - "total": 17998, - "total_gz": 8173 + "a.js": 9593, + "a.js.gz": 4230, + "a.wasm": 7615, + "a.wasm.gz": 3471, + "total": 17760, + "total_gz": 8081 } diff --git a/test/code_size/embind_val_wasm.json b/test/code_size/embind_val_wasm.json index 9af792edee31e..69ed419b496d4 100644 --- a/test/code_size/embind_val_wasm.json +++ b/test/code_size/embind_val_wasm.json @@ -1,10 +1,10 @@ { "a.html": 552, "a.html.gz": 380, - "a.js": 6849, - "a.js.gz": 2947, - "a.wasm": 9568, - "a.wasm.gz": 4911, - "total": 16969, - "total_gz": 8238 + "a.js": 6724, + "a.js.gz": 2900, + "a.wasm": 9528, + "a.wasm.gz": 4896, + "total": 16804, + "total_gz": 8176 } diff --git a/test/embind/embind.test.js b/test/embind/embind.test.js index 9e17adf6173b7..81afe5b8d7465 100644 --- a/test/embind/embind.test.js +++ b/test/embind/embind.test.js @@ -449,33 +449,6 @@ module({ assert.equal('ABCD', e); }); - test("can pass Uint8Array to std::basic_string", function() { - var e = cm.emval_test_take_and_return_std_basic_string_unsigned_char(new Uint8Array([65, 66, 67, 68])); - assert.equal('ABCD', e); - }); - - test("can pass long string to std::basic_string", function() { - var s = 'this string is long enough to exceed the short string optimization'; - var e = cm.emval_test_take_and_return_std_basic_string_unsigned_char(s); - assert.equal(s, e); - }); - - test("can pass Uint8ClampedArray to std::basic_string", function() { - var e = cm.emval_test_take_and_return_std_basic_string_unsigned_char(new Uint8ClampedArray([65, 66, 67, 68])); - assert.equal('ABCD', e); - }); - - - test("can pass Int8Array to std::basic_string", function() { - var e = cm.emval_test_take_and_return_std_basic_string_unsigned_char(new Int8Array([65, 66, 67, 68])); - assert.equal('ABCD', e); - }); - - test("can pass ArrayBuffer to std::basic_string", function() { - var e = cm.emval_test_take_and_return_std_basic_string_unsigned_char((new Int8Array([65, 66, 67, 68])).buffer); - assert.equal('ABCD', e); - }); - test("can pass string to std::string", function() { var string = stdStringIsUTF8?"aeiáéíαειЖЛФ從獅子€":"ABCD"; diff --git a/test/embind/embind_test.cpp b/test/embind/embind_test.cpp index 3b5d3c9044682..f86349da05856 100644 --- a/test/embind/embind_test.cpp +++ b/test/embind/embind_test.cpp @@ -246,10 +246,6 @@ std::string emval_test_take_and_return_std_string_const_ref(const std::string& s return str; } -std::basic_string emval_test_take_and_return_std_basic_string_unsigned_char(std::basic_string str) { - return str; -} - std::wstring take_and_return_std_wstring(std::wstring str) { return str; } @@ -1914,7 +1910,6 @@ EMSCRIPTEN_BINDINGS(tests) { //function("emval_test_take_and_return_const_char_star", &emval_test_take_and_return_const_char_star); function("emval_test_take_and_return_std_string", &emval_test_take_and_return_std_string); function("emval_test_take_and_return_std_string_const_ref", &emval_test_take_and_return_std_string_const_ref); - function("emval_test_take_and_return_std_basic_string_unsigned_char", &emval_test_take_and_return_std_basic_string_unsigned_char); function("take_and_return_std_wstring", &take_and_return_std_wstring); function("take_and_return_std_u16string", &take_and_return_std_u16string); function("take_and_return_std_u32string", &take_and_return_std_u32string);