Skip to content

Add support for member pointer casting #973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Lancern opened this issue Oct 15, 2024 · 0 comments · Fixed by #1424
Closed

Add support for member pointer casting #973

Lancern opened this issue Oct 15, 2024 · 0 comments · Fixed by #1424
Assignees
Labels
enhancement New feature or request

Comments

@Lancern
Copy link
Member

Lancern commented Oct 15, 2024

Given class types Base and Derived, assume Base is a public non-ambiguous non-virtual base class of Derived, there are 4 valid ways to cast relevant member pointers:

  • Casts on pointer to data members:
    • Implicit cast from T Base::* to T Derived::*
    • Explicit cast from T Derived::* to T Base::*
  • Casts on pointer to member functions:
    • Implicit cast from Ret (Base::*)(Args) to Ret (Derived::*)(Args)
    • Explicit cast from Ret (Derived::*)(Args) to Ret (Base::*)(Args)

This issue tracks the implementation status of these 4 cast types.

@Lancern Lancern self-assigned this Oct 15, 2024
@seven-mile seven-mile added the enhancement New feature or request label Nov 18, 2024
bcardosolopes pushed a commit that referenced this issue Dec 2, 2024
This PR adds support for base-to-derived and derived-to-base casts on
pointer-to-data-member values.

Related to #973.
Lancern added a commit that referenced this issue Mar 1, 2025
… functions (#1424)

This PR adds CIRGen and LLVM lowering support for base-to-derived and
derived-to-base cast operations on pointers to member functions.

This PR includes a new operation `cir.update_member` to help the LLVM
lowering procedure of such cast operations.

Resolve #973 .
lanza pushed a commit that referenced this issue Mar 18, 2025
This PR adds support for base-to-derived and derived-to-base casts on
pointer-to-data-member values.

Related to #973.
lanza pushed a commit that referenced this issue Mar 18, 2025
… functions (#1424)

This PR adds CIRGen and LLVM lowering support for base-to-derived and
derived-to-base cast operations on pointers to member functions.

This PR includes a new operation `cir.update_member` to help the LLVM
lowering procedure of such cast operations.

Resolve #973 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants