Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dcl.meaning.general] p6 Which specifiers in the decl-specifier-seq contribute to the type of declarations are underspecified #5157

Open
xmh0511 opened this issue Dec 19, 2021 · 0 comments

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Dec 19, 2021

For the type of a declaration, only [dcl.meaning.general] p6 has a brief statement, that is

Thus, (for each declarator) a declaration has the form

T D

where T is of the form attribute-specifier-seqopt decl-specifier-seq and D is a declarator. Following is a recursive procedure for determining the type specified for the contained declarator-id by such a declaration.

First, the decl-specifier-seq determines a type. In a declaration

T D

the decl-specifier-seq T determines the type T.

decl-specifier-seq is a sequence of decl-specifiers, where decl-specifier is separated into nine kinds of specifiers. The current standard does not explicitly specify which specifiers contribute to the type of declarations. Although, the text "type" in defining-type-specifier may hint that they designate the type. I think we may narrow the scope of specifiers in provision [dcl.meaning.general] p6, which may be that

In a declaration

T D

Except otherwise specified, the defining-type-specifiers in the decl-specifier-seq determine the declaration's type.

For instance, the exception is constexpr specifier, when it is declared in an object declaration, the effect on the type is the same as const, which is a special case specified in [dcl.constexpr] p10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant