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

2024-04-05


808. Non-type decl-specifiers versus max-munch

Section: 9.2  [dcl.spec]     Status: CD2     Submitter: UK     Date: 3 March, 2009

N2800 comment UK 83

[Voted into WP at March, 2010 meeting.]

According to 9.2 [dcl.spec] paragraph 2,

The longest sequence of decl-specifiers that could possibly be a type name is taken as the decl-specifier-seq of a declaration.

However, there are many decl-specifiers that cannot appear in a type name that are, nonetheless, part of a declaration's decl-specifier-seq, such as typedef, friend, static, etc.

Proposed resolution (November, 2009):

Change 9.2 [dcl.spec] paragraph 2 as follows:

The longest sequence of decl-specifiers that could possibly be a type name is taken as the decl-specifier-seq of a declaration If a type-name is encountered while parsing a decl-specifier-seq, it is interpreted as part of the decl-specifier-seq if and only if there is no previous type-specifier other than a cv-qualifier in the decl-specifier-seq.. The sequence shall be self-consistent as described below. [Example:...