[v638][CPyCppyy] Add wchar_t*_Nonnull converter for libc++ std::wstring ctors#21353
Merged
dpiparo merged 1 commit intoroot-project:v6-38-00-patchesfrom Feb 24, 2026
Merged
[v638][CPyCppyy] Add wchar_t*_Nonnull converter for libc++ std::wstring ctors#21353dpiparo merged 1 commit intoroot-project:v6-38-00-patchesfrom
dpiparo merged 1 commit intoroot-project:v6-38-00-patchesfrom
Conversation
Apple's libc++ headers (especially in newer macOS/Xcode SDKs) annotate some `std::basic_string<wchar_t>` constructors with Clang nullability qualifiers (e.g. `const wchar_t* _Nonnull`). The cppyy backend currently preserves these qualifiers in the type spelling, so the existing `wchar_t*` converter does not match `wchar_t*_Nonnull`. This breaks Python string to std::wstring conversions and causes STL string tests to fail on macOS. Add an explicit converter mapping for `wchar_t*_Nonnull` to reuse the existing WCStringConverter. A more general solution would be to strip/normalize Clang attributes during type matching. (cherry picked from commit 43a8eff)
Test Results 18 files 18 suites 2d 17h 25m 31s ⏱️ Results for commit 6f4842e. |
a9adbab
into
root-project:v6-38-00-patches
30 of 32 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Apple's libc++ headers (especially in newer macOS/Xcode SDKs) annotate some
std::basic_string<wchar_t>constructors with Clang nullability qualifiers (e.g.const wchar_t* _Nonnull).The cppyy backend currently preserves these qualifiers in the type spelling, so the existing
wchar_t*converter does not matchwchar_t*_Nonnull. This breaks Python string to std::wstring conversions and causes STL string tests to fail on macOS.Add an explicit converter mapping for
wchar_t*_Nonnullto reuse the existing WCStringConverter. A more general solution would be to strip/normalize Clang attributes during type matching.(cherry picked from commit 43a8eff)