Skip to content

[dcl.spec.general] p2 prevents the valid type combination #4796

@xmh0511

Description

@xmh0511
unsigned  long  long int const volatile a = 0;

In this declaration, the complete decl-specifier-seq is unsigned long long int const volatile. Where unsigned, long, long, int are all simple-type-specifiers, which in turn are type-specifiers, which are also defining-type-specifiers; While const and volatile are both cv-qualifiers, which are type-specifiers, which are also defining-type-specifiers. Hence, in this complete decl-specifier-seq, the defining-type-specifier appears six times.

However, [dcl.spec.general] p2 says

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

Obviously, defining-type-specifier appears more than once that are not only long. I think the intent of this rule says each indivisible specifier shall appear at most once except that long may appear twice, I would like to name the indivisible specifier as atomic specifier(e.g., int, long, short, const, virtual, explicit ...). But It's not formal wording, maybe we can use some terms to precisely phrase such the meaning?

Metadata

Metadata

Assignees

Labels

cwgIssue must be reviewed by CWG.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions