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

Adds interop::IsMutablePtrRefType: the string-based check from the ROOT migration branch was adapted to be more robust with CppInterOp.

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.

@aaronj0
aaronj0 force-pushed the tptr-const-ref-converter branch from 6b53387 to 2881ffa Compare September 8, 2026 06:53
@aaronj0
aaronj0 requested a review from guitargeek September 8, 2026 06:54
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.
@aaronj0
aaronj0 force-pushed the tptr-const-ref-converter branch from 2881ffa to cde66df Compare September 8, 2026 08:56
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