[dcl.init] Remove redundant specification of when value-initialization occurs #3891
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[dcl.init] p17.4 and [dcl.init] p11 both specify when value-initialization is performed. This can just be specified in p17.4, since it describes the semantics of initializers. The note in p11 is also moved to p17.4.
While on the topic, both of the aforementioned paragraphs only specify initialization of an object with
()
, but not a reference, and [dcl.init.ref] does not handle this case either.One way to resolve this would be:
T
is a reference type, the program is ill-formed"()
, value-initialization is performed", and move it above p17.2In addition to this, there definitely is room for improvement in the rest of the subclause. Currently, p17 specifies "the semantics of initializers", however if we change this to specify the process of initialization, we can make initialization a defined term (something like "Initialization determines the initial value of an object or the entity to which a reference is bound from an initializer. [...] Initialization of an object or reference is performed using the following procedure: [...]:"), and move some of the floating sentences into p17, such as p12. Floating sentence p14 and p19 both refer to the same form of initialization, so they can be merged. However, these are definitely out of the scope of this PR, so let me know if this is worth pursuing,