Skip to content

[v638][CPyCppyy] Add wchar_t*_Nonnull converter for libc++ std::wstring ctors#21353

Merged
dpiparo merged 1 commit intoroot-project:v6-38-00-patchesfrom
guitargeek:bp_1
Feb 24, 2026
Merged

[v638][CPyCppyy] Add wchar_t*_Nonnull converter for libc++ std::wstring ctors#21353
dpiparo merged 1 commit intoroot-project:v6-38-00-patchesfrom
guitargeek:bp_1

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

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)

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)
@github-actions
Copy link
Copy Markdown

Test Results

    18 files      18 suites   2d 17h 25m 31s ⏱️
 3 712 tests  3 712 ✅ 0 💤 0 ❌
65 188 runs  65 188 ✅ 0 💤 0 ❌

Results for commit 6f4842e.

@dpiparo dpiparo merged commit a9adbab into root-project:v6-38-00-patches Feb 24, 2026
30 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants