[dcl.init.ref] instructs performing direct initialization after applying a user-defined conversion
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 221
- Forks
- 813
- Avg merge
- 16h 4m
- Merged PRs (30d)
- 36
Description
[dcl.init.ref] paragraph 5, bullet 4, sub-bullet 1 specifies the following:
If T1 or T2 is a class type and T1 is not reference-related to T2, user-defined conversions are
considered using the rules for copy-initialization of an object of type “cv1 T1” by user-defined
conversion (9.4, 12.4.1.4, 12.4.1.5); the program is ill-formed if the corresponding non-reference
copy-initialization would be ill-formed. The result of the call to the conversion function, as
described for the non-reference copy-initialization, is then used to direct-initialize the reference.
For this direct-initialization, user-defined conversions are not considered.
The highlighted wording (which requires performing direct initialization after applying the user-defined conversion) was added in CWG1604. Given that "user-defined conversions are not considered" for the next step of the initialization, I believe that requiring a specific type of initialization does not have any effect on the outcome.
I think there is another issue with the quoted text above, namely:
[...] The result of the call to the conversion function [...]
I believe that the user-defined conversion referred to here could use either a converting constructor or a conversion function, not just a conversion function.
Thank you!
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
Start with [dcl.init.ref] paragraph 5, bullet 4, sub-bullet 1 and the linked CWG1604 issue. Determine whether the highlighted direct-initialization wording has an observable effect and whether “conversion function” covers converting constructors. Done means documenting the resolution and identifying any required standard wording change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, tex
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100