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] p5 Normalization of any declaration #4923

Open
xmh0511 opened this issue Sep 21, 2021 · 0 comments
Open

[dcl.meaning.general] p5 Normalization of any declaration #4923

xmh0511 opened this issue Sep 21, 2021 · 0 comments

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Sep 21, 2021

[dcl.meaning.general] p5 says

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

T D

where T is of the form attribute-specifier-seq opt 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.

However, not all declarations consist of only T and D, such as

int i = 0;  // #1
template<class T>
struct C{
   void fun() requires (sizeof(T)> 0);  // #2
};

The complete declaration at #1 comprises the initializer while the declaration at #2 comprises a requires-clause. It can arguably say the form T D cannot be used to designate(match) these declarations at all. The subsequent subclauses that describe the type of a declaration all base on the form T D. Should we give a normalization to any declaration in [dcl.meaning.general] p5 in order to make these subsequence subclauses apply to these declarations? That is

Thus, for a declaration D0, a declaration has the form

T D

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

Hence, for any declaration, we can abstract a normalization form T D from it such that the subsequent descriptions base on "T D" can work for that declaration.

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