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

[class.mem.general]/12 contains a false statement #4197

Closed
jabelloc opened this issue Sep 15, 2020 · 1 comment
Closed

[class.mem.general]/12 contains a false statement #4197

jabelloc opened this issue Sep 15, 2020 · 1 comment

Comments

@jabelloc
Copy link

[class.mem.general]/12:

The decl-specifier-seq may be omitted in constructor, destructor, and conversion function declarations only; when declaring another kind of member the decl-specifier-seq shall contain a type-specifier that is not a cv-qualifier. The member-declarator-list can be omitted only after a class-specifier or an enum-specifier or in a friend declaration. A pure-specifier shall be used only in the declaration of a virtual function that is not a friend declaration.

The highlighted statement above is obviously wrong. The struct below is a perfectly valid class:

struct A{
    const int i = 1; 
};
@jabelloc
Copy link
Author

The sentence is correct. My interpretation was wrong. The sentence means to say:

the decl-specifier-seq shall contain at least one 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

1 participant