https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115012
Bug ID: 115012
Summary: noptr-abstract-pack-declarator parsing bug with T...
[N]
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
CC: daniel.kruegler at googlemail dot com, egor.pugin at gmail
dot com,
mpolacek at gcc dot gnu.org, unassigned at gcc dot gnu.org,
webrown.cpp at gmail dot com
Depends on: 113798
Blocks: 110338
Target Milestone: ---
+++ This bug was initially created as a clone of Bug #113798 +++
As mentioned in the https://wg21.link/P2662R3 paper, we aren't parsing
correctly T...[N] parameters.
template <int N, typename ...T>
void
foo (T... x[N])
{
}
template <int N, typename T>
void
bar (T [N])
{
}
template <int N, typename ...T>
void
baz (T... [N])
{
}
template <int N, typename ...T>
void
qux (T... [N][N])
{
}
void
corge (int a[10], double b[10], int c[5][5], float d[5][5])
{
foo <10, int, double> (a, b);
bar <10, int> (a);
baz <10, int, double> (a, b);
qux <5, int, float> (c, d);
}
is accepted by clang++ but not by GCC nor MSCV.
This is going to change in C++26 with pack indexing, but in C++11 .. C++23 it
should be valid.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110338
[Bug 110338] Implement C++26 language features
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113798
[Bug 113798] [C++26] P2662R3 - Pack indexing