I wonder Is it a mis-wording in the following quote, that is
The instantiation of a pack expansion that is neither a sizeof... expression nor a fold-expression produces a list E1,E2,...En , where N is the number of elements in the pack expansion parameters. Each Ei is generated by instantiating the pattern and replacing each pack expansion parameter with its ith element. Such an element, in the context of the instantiation, is interpreted as follows:
- if the pack is a template parameter pack, the element is a template parameter of the corresponding kind (type or non-type) designating the type or value from the template argument; otherwise,
- if the pack is a function parameter pack, the element is an id-expression designating the function parameter that resulted from the instantiation of the pattern where the pack is declared.
The pattern of a function parameter pack is a parameter-declaration without ellipsis because it's defined as the following:
temp.variadic#4
A pack expansion consists of a pattern and an ellipsis, the instantiation of which produces zero or more instantiations of the pattern in a list (described below). The form of the pattern depends on the context in which the expansion occurs. Pack expansions can occur in the following contexts:
- [...]
- In a function parameter pack ([dcl.fct]); the pattern is the parameter-declaration without the ellipsis.
A usual parameter-declaration consists of :
- attribute-specifier-seq (opt) decl-specifier-seq declarator
- attribute-specifier-seq (opt) decl-specifier-seq declarator = initializer-clause
- attribute-specifier-seq (opt) decl-specifier-seq abstract-declarator(opt)
- attribute-specifier-seq (opt) decl-specifier-seq abstract-declarator (opt) = initializer-clause
In any case , the decl-specifier-seq is not an optional component.
In this example
template<typename...T>
void func(T...args){
}
T...args is a function parameter pack, thereof, T args is its pattern. So my issues is, why the element generated from instantiation of a pattern of a function parameter pack is id-expression, However the id-expression is only a part of declarator of a parameter-declaration.