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

[expr.type.conv] Remove unnecessary indirection of "specified type" when the resulting type will always be unqualified void #4397

Merged
merged 1 commit into from Dec 14, 2020

Conversation

randomnetcat
Copy link
Contributor

[expr.type.conv]/2 states that:

Otherwise, if the type is cv void and the initializer is () or {} [...], the expression is a prvalue of the specified type that performs no initialization.

This is unnecessarily indirect. As per Richard Smith in a clang bug report:

See [expr.type]p2:

"If a prvalue initially has the type “cv T”, where T is a cv-unqualified non-class, non-array type, the type of the expression is adjusted to T prior to any further analysis."

The specification can be made clearer by changing the reference to "the specified type" to explicit state that the type is void without any semantic impact, and as such is an editorial change.

…hen the resulting type will always be unqualified void
@tkoeppe tkoeppe merged commit 09bdfbd into cplusplus:master Dec 14, 2020
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 this pull request may close these issues.

None yet

3 participants