https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113798

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot 
gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I have a patch that, so far, compiles this correctly:

```
// P2662R3 - Pack Indexing
// PR c++/113798
// { dg-do compile { target c++17 } }
// { dg-options "" }

template<int I, typename... Ts>
using Type = Ts...[I]; // { dg-warning "pack indexing only available with" "" {
target c++23_down } }

template<int I, auto... Ts>
constexpr auto Var = Ts...[I]; // { dg-warning "pack indexing only available
with" "" { target c++23_down } }

template <int I, auto...Ts>
decltype(Ts...[I])  // { dg-warning "pack indexing only available with" "" {
target c++23_down } }
foo ()
{
  return Ts...[I]; // { dg-warning "pack indexing only available with" "" {
target c++23_down } }
}

void
g ()
{
  using U = Type<1, char, int, float>;
  using U = int;

  constexpr auto V = Var<2, 0, 1, 42>;
  static_assert (V == 42);

  int r = foo<2, 0, 1, 42>();
}
```

Reply via email to