Skip to content

[cppyy] Deal with Clang attributes like _Nonnull #21350

@guitargeek

Description

@guitargeek

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.

In #21348, we added 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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions