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

Statement in the Note in [class.union.anon]/1 should have normative status #4210

Closed
jabelloc opened this issue Sep 20, 2020 · 5 comments · Fixed by #4212
Closed

Statement in the Note in [class.union.anon]/1 should have normative status #4210

jabelloc opened this issue Sep 20, 2020 · 5 comments · Fixed by #4212
Assignees

Comments

@jabelloc
Copy link

[class.union.anon]/1:

A union of the form
    union { member-specification } ;
is called an anonymous union; it defines an unnamed type and an unnamed object of that type called an
anonymous union object. Each member-declaration in the member-specification of an anonymous union shall
either define a non-static data member or be a static_assert-declaration. [Note: Nested types, anonymous
unions, and functions cannot be declared within an anonymous union. — end note
] The names of the
members of an anonymous union shall be distinct from the names of any other entity in the scope in which
the anonymous union is declared. ...

Note also that the last statement in the next paragraph is a mere duplication of a similar statement in the Note above.

[class.union.anon]/2:

Anonymous unions declared in a named namespace or in the global namespace shall be declared static.
Anonymous unions declared at block scope shall be declared with any storage class allowed for a block-scope
variable, or with no storage class. A storage class is not allowed in a declaration of an anonymous union in a
class scope. An anonymous union shall not have private or protected members (11.9). An anonymous union
shall not have member functions
.

@jensmaurer
Copy link
Member

jensmaurer commented Sep 20, 2020

Core Issue 1621 made the note normative (Belfast 2019). It's already in the current draft and shown by the link you pointed to.

I agree with your second point.

@jabelloc
Copy link
Author

I observed in your pull-request that you have also removed from [class.union.anon]/2 the following sentence:

An anonymous union shall not have private or protected members

Was this your intention, or was it inadvertent?

@jensmaurer
Copy link
Member

That was intentional. See the addition of "public" in p1.

@jensmaurer
Copy link
Member

See the pull request #4212, the second green blob.

@jabelloc
Copy link
Author

I have just found that. Thanks.

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

Successfully merging a pull request may close this issue.

2 participants