https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117472
Bug ID: 117472
Summary: pack of function parameters without a name
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: mpolacek at gcc dot gnu.org
Target Milestone: ---
A test from <https://eel.is/c++draft/diff#cpp23.dcl.dcl-2> should compile in
C++23:
```
template <typename... T>
void f(T... [1]);
template <typename... T>
void g(T... ptr[1]);
int main() {
f<int, double>(nullptr, nullptr); // ill-formed, previously void f<int,
double>(int [1], double [1])
g<int, double>(nullptr, nullptr); // ok
}
```
but we emit
pack-indexing11.C:7:13: error: expected ‘,’ or ‘...’ before ‘[’ token
7 | void f(T... [1]);
| ^
pack-indexing11.C: In function ‘int main()’:
pack-indexing11.C:11:18: error: cannot convert ‘std::nullptr_t’ to ‘int’
11 | f<int, double>(nullptr, nullptr); // { dg-error "no matching
function" }
| ^~~~~~~
| |
| std::nullptr_t
pack-indexing11.C:7:8: note: initializing argument 1 of ‘void f(T ...) [with
T = {int, double}]’
7 | void f(T... [1]);
| ^~~~