There are numerous problems with variadic parameters.
In ordinary functions and methods, the grammar given is
parameter-list:
...
parameter-declaration-list ,opt
parameter-declaration-list , ...
But this isn't complete; the "..." is allowed to have an attribute, a type and a name, the same as any other parameter. The grammar should be
variadic-parameter:
...
attribute-specification-opt type-specifier ... variable-name
Note that if it has a type then it must have a name, and if it has a name then it must have a type.
The grammar for constructor parameters is even more wrong:
constructor-parameter-declaration-list:
constructor-parameter-declaration
constructor-parameter-declaration-list , constructor-parameter-declaration
First of all, this does not allow a trailing comma when it should. Second, it makes no mention of variadic parameters, which are legal in a constructor.
Note that a variadic parameter with a name in a constructor is also allowed to have a visibility modifier, so that should be in the grammar as well.
There are numerous problems with variadic parameters.
In ordinary functions and methods, the grammar given is
But this isn't complete; the "..." is allowed to have an attribute, a type and a name, the same as any other parameter. The grammar should be
Note that if it has a type then it must have a name, and if it has a name then it must have a type.
The grammar for constructor parameters is even more wrong:
First of all, this does not allow a trailing comma when it should. Second, it makes no mention of variadic parameters, which are legal in a constructor.
Note that a variadic parameter with a name in a constructor is also allowed to have a visibility modifier, so that should be in the grammar as well.