Skip to content

[cpyrt] Exempt T* const& from the mutable pointer-reference ban - #92

Open
aaronj0 wants to merge 1 commit into
compiler-research:mainfrom
aaronj0:tptr-const-ref-converter
Open

[cpyrt] Exempt T* const& from the mutable pointer-reference ban#92
aaronj0 wants to merge 1 commit into
compiler-research:mainfrom
aaronj0:tptr-const-ref-converter

Conversation

@aaronj0

@aaronj0 aaronj0 commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

TypeManip::compound() strips const allowing both T*& and T* const& reach the converter factory as "&" and were rejected alike. The callee cannot rebind the pointer through a T const&, which is the ban's sole rationale; ask the type via a new interop::IsMutablePtrRefType (the referenced type is a pointer and not const-qualified) and route const ones to the regular instance-pointer converters. In the string-based factory a name that resolves to no type keeps the ban.

TypeManip::compound() strips const, so T*& and T* const& both reach the
converter factory as "*&" and were rejected alike. The callee cannot
rebind the pointer through a T* const&, which is the ban's sole
rationale; ask the type via a new interop::IsMutablePtrRefType (the
referenced type is a pointer and not const-qualified) and route const
ones to the regular instance-pointer converters. In the string-based
factory a name that resolves to no type keeps the ban.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant