Remove basic_string<unsigned char> from embind #23070
Open
+9
−43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Only
char
,wchar
,char8
,char16
, andchar32
are valid specializations forstd::basic_string
:https://en.cppreference.com/w/cpp/string/basic_string
But libc++ had a base template for
basic_string
that allowed any type to be passed for a long time. It looks there have been several attempts to remove this after which they restored it due to complaints, in chronological order:llvm/llvm-project@aeecef0 llvm/llvm-project@08a0faf llvm/llvm-project@e30a148 llvm/llvm-project#66153
llvm/llvm-project#72694
The last one, llvm/llvm-project#72694, eventually removed it. So
std::basic_string<unsigned char>
is not allowed anymore. This removes all uses ofstd::basic_string<unsigned char>
from embind.This needs to be done to update libc++ to LLVM 19 (#22994). I'm uploading this as a separate PR because this removes a functionality from embind.