This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-12-20
[Accepted as a DR at the June, 2021 meeting.]
According to 9.3.4.5 [dcl.array] paragraph 1,
In a declarationT D whereD has theform
D1 [constant-expressionopt]attribute-specifier-seqopt
and the type of the identifier in the declarationTD1 is“derived-declarator-type-listT”,then the type of the identifier ofD is an arraytype; if the type of the identifier ofD containstheautotype-specifier, the program isill-formed.
This formulation forbids useful constructs like
int a[3]; auto (*p)[3] = &a;
(accepted by current implementations) and should berelaxed to accommodate such cases.
Notes from the February, 2019 meeting:
CWG agreed that the example should be accepted.
Notes from the May 25, 2021 teleconference:
It was observed that CWG rejected the same example asbeing "not a defect" in consideringissue 1222. However, the use ofauto hassignificantly expanded since that time and the prohibitionof such declarations now seems inconsistent.
Proposed resolution, May, 2021:
Change 9.3.4.5 [dcl.array] paragraph 4 asfollows:
U is called the array element type; this type shallnot bea placeholder type(9.2.9.7 [dcl.spec.auto]),a reference type, afunction type, an array of unknown bound,orcvvoid.
Change 9.3.4.6 [dcl.fct] paragraph 11 as follows:
The return type shall be a non-array object type, areference type, orcvvoid.[Note:An array of placeholder type is considered an array type.—end note]
Change 9.2.9.7.2 [dcl.type.auto.deduct] paragraph 2 as follows:
A typeTcontaining a placeholder type, and a correspondinginitializerE, are determined as follows:
for a non-discardedreturn statementthat occurs in a function declared with a return type thatcontains a placeholder type,T is the declaredreturn type andE is the operand ofthereturn statement. If thereturnstatement has no operand, thenEisvoid();
for a variable declared with a type that contains aplaceholder type,T is the declared type of thevariable andE is the initializer. If theinitialization is direct-list-initialization, theinitializer shall be abraced-init-list containingonly a singleassignment-expression andE istheassignment-expression;
for a non-type template parameter declared with atype that contains a placeholder type,T is thedeclared type of the non-type template parameterandE is the corresponding templateargument.
T shall not be an array type. In thecase of areturn statement with no operand...