This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
[Accepted as a DR at the February, 2023 meeting.]
(From editorial issue 3953.)
Although an object cannot be defined with a type of cv void, there is nothing preventing a non-defining declaration of an object with that type. Should it be disallowed?
Notes from the December, 2020 teleconference:
Such declarations are permitted in C, so this question was referred to the C liaison for investigation.
CWG resolved to making such declarations ill-formed.
Proposed resolution (approved by CWG 2022-12-02; amended 2023-02-06):
Change in 9.1 [dcl.pre] paragraph 7 as follows:
If the decl-specifier-seq contains the typedef specifier, the declaration is
calleda typedef declaration and each declarator-id is declared to be a typedef-name, synonymous with its associated type (9.2.4 [dcl.typedef]). [ Note 4: Such a declarator-id is an identifier (184.108.40.206 [class.conv.fct]). —end note] If the decl-specifier-seq contains no typedef specifier,the declaration is calleda function declaration if the type associated with a declarator-id is a function type (220.127.116.11 [dcl.fct]) andan object declaration otherwise.
[ Example:int f(), x; // OK, function declaration for f and object declaration for x extern void g(), // OK, function declaration for g y; // error: void is not an object type
-- end example ]