This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 114a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-04-18


1830. Repeated specifiers

Section: 9.1  [dcl.pre]     Status: CD4     Submitter: Ville Voutilainen     Date: 2014-01-10

[Moved to DR at the November, 2014 meeting.]

Although repeated type-specifiers such as const are forbidden, there is no such prohibition against repeated non-type specifiers like constexpr and virtual. Should there be?

On the “con” side, it's not clear that such a prohibition actually helps anyone; it could happen via macros, and a warning about non-macro use could be a QoI issue. Also, C99 moved in the opposite direction, removing the prohibition against repeated cv-qualifiers.

Proposed resolution (February, 2014):

Add the following as a new paragraph before 9.2 [dcl.spec] paragraph 2:

Each decl-specifier shall appear at most once in the complete decl-specifier-seq of a declaration, except that long may appear twice.

If a type-name is encountered...