[class.copy.ctor] p10 What is the selected one by overload resolution for a variant member in the context of implicitly copy/move constructor for a union?
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 221
- Forks
- 813
- Avg merge
- 16h 4m
- Merged PRs (30d)
- 36
Description
[class.copy.ctor] p10 states that
An implicitly-declared copy/move constructor is an inline public member of its class. A defaulted copy/move constructor for a class X is defined as deleted ([dcl.fct.def.delete]) if X has:
- [...]
- a variant member whose corresponding constructor as selected by overload resolution is non-trivial,
Since in [class.copy.ctor] p15, we have said that
The implicitly-defined copy/move constructor for a union X copies the object representation ([basic.types]) of X.
According to [basic.types.general] p4
The object representation of an object of type T is the sequence of N unsigned char objects taken up by the object of type T, where N equals sizeof(T).
Hence, copying the object representation of X means that copies the sequence of N unsigned char objects taken up by the object of type X, where N equals sizeof(X). So, there is no overload resolution here since we didn't invoke any constructor(function). This is a contradictory point. Should we say that?
a variant member whose corresponding constructor, as selected by overload resolution as if the variant member is copy-initialized from the corresponding source
As if the overload resolution can occur in this context to determine the constructor for the variant member.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue points to [class.copy.ctor] paragraphs 10 and 15 and [basic.types.general] paragraph 4; start by reading those provisions together. Determine whether the wording should explicitly describe overload resolution for a variant member during implicit copy or move constructor rules, and consider the proposed clarification. Done means the apparent contradiction is resolved in the draft wording.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100