Skip to content
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

Mangling for C++ pack indexing #175

Open
cor3ntin opened this issue Jan 10, 2024 · 1 comment
Open

Mangling for C++ pack indexing #175

cor3ntin opened this issue Jan 10, 2024 · 1 comment

Comments

@cor3ntin
Copy link

Hey folks

Pack indexing (https://wg21.link/p2662r3) was approved for C++26.
We will need to mangle these things.

A pack indexing is constituted of a pattern (which is either a type or an expression) and an indexing expression.
I am unfortunately not familiar enough with the ABI to offer suggestions

@rjmccall
Copy link
Collaborator

rjmccall commented Jan 11, 2024

Looks like it's a new type-level operator and a new expression-level operator. Apparently it will eventually be accepted as a template-name as well, but that's not currently included? Anyway, this should be straightforward; we just need to add new forms to <expression> and <type>.

Typical uses of this are probably going to exacerbate our existing problems with partial substitution, though. Consider when a pack indexing operator is used in the signature of a templated member of a class template and we can't expand the pack in the instantiated dependent signature of the template:

template <class... T> struct tuple {
  template <unsigned I> T...[I] get();
};

We'll need to solve that problem.

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

No branches or pull requests

2 participants