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.type.general] p3 The grammar type-specifier-seq does not comprise defining-type-specifier #5540

Open
xmh0511 opened this issue Jun 26, 2022 · 1 comment

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Jun 26, 2022

[dcl.type.general] p3 says

Except in a declaration of a constructor, destructor, or conversion function, at least one defining-type-specifier that is not a cv-qualifier shall appear in a complete type-specifier-seq or a complete decl-specifier-seq.

The grammar type-specifier-seq is the sequence of type-specifier, which can never include a defining-type-specifier. A defining-type-specifier can be a type-specifer but not the way around; that is, defining-type-specifier is a wider component than type-specifer. As specified in https://stackoverflow.com/questions/62506440/why-a-conversion-function-declaration-does-not-require-at-least-one-defining-typ

The suggested resolution might be

Except the decl-specifier-seq in a declaration of a constructor, destructor, or conversion function, a complete decl-specifier-seq shall contain at least one defining-type-specifier that is not a cv-qualifier, and a complete type-specifier-seq shall contain at least one type-specifier that is not a cv-qualifier.

As a drive-by, the exception should only apply to the decl-specifier-seq of the conversion function, since the type-specifier-seq in its conversion-type-id should obey the rule; comprise at least a type-specifier that is not a cv-qualifier.

@jensmaurer
Copy link
Member

The proposed amendment still misses a rule such as "A complete defining-type-specifier-seq shall contain at least one defining-type-specifier that is not a cv-qualifier."

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

2 participants