cplusplus / cplusplus/draft

[dcl.init.aggr] p2 Elements of an anonymous union

Open
#4,899 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TeX
Stars
221
Forks
813
Avg merge
16h 4m
Merged PRs (30d)
36

Description

The elements of an aggregate are:

  • [...]
  • for a class, the direct base classes in declaration order, followed by the direct non-static data members ([class.mem]) that are not members of an anonymous union, in declaration order.
static union {
   int c;
};

The member c is an element of the anonymous union, I believe. Presumably, the intent of [dcl.init.aggr] p2 is to exclude the member of an anonymous union member of a class of which that member is a direct member. Should we say

for a class, the direct base classes in declaration order, followed by the direct non-static data members ([class.mem]) that are not members of an anonymous union member, in declaration order.

It could make that rule admit that a member of an anonymous union is an element of the anonymous union.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue concerns [dcl.init.aggr] paragraph 2 and cites [class.mem], with an anonymous-union example. Start by reading those clauses in the draft and verify how members of an anonymous union are classified. Done means the standard wording unambiguously distinguishes class elements from anonymous-union elements.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, tex
Domain
compilers, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.