You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In subclause 8.2.3 [expr.type.conv] paragraph 2 of the 2017 DIS, the structure of:
If the initializer is a parenthesized single expression, the type conversion expression is equivalent (in definedness, and if defined in meaning) to the corresponding cast expression ([expr.cast]).
If the type is cvvoid and the initializer is (), [ ... ].
Otherwise, [an] object is direct-initialized (11.6) with the initializer.
Presents a interpretation where the first sentence is elaborated upon by the latter two as opposed to covering disjoint cases.
Given:
int *f(void *p) {
typedef int *IntPtr;
return IntPtr(p);
}
The C-style cast interpretation is valid; however, the direct-initialization is not.
Thus the first sentence conflicts with the latter two under said interpretation.
Furthermore, the parenthetical in the first sentence is meant to be parsed as:
equivalent (in definedness; and if defined, in meaning) to the corresponding cast expression
However, it may be taken as:
equivalent in definedness, should the corresponding cast expression be defined
Suggestion:
Move the latter two sentences under an "Otherwise" bound to the first, with appropriate indentation.
Indent the "then" part of the first as well.
Suggestion:
Improve punctuation within the parenthetical in the first sentence.
The text was updated successfully, but these errors were encountered:
I think starting the second sentence with "Otherwise" already helps: It presents a clear "If ... Otherwise, if ... Otherwise, ..." ladder. Also, simply striking the rather strange parenthetical remark seems not to lose anything and fixes the hostile interpretation issue.
jensmaurer
added a commit
to jensmaurer/draft
that referenced
this issue
Apr 5, 2017
In subclause 8.2.3 [expr.type.conv] paragraph 2 of the 2017 DIS, the structure of:
Presents a interpretation where the first sentence is elaborated upon by the latter two as opposed to covering disjoint cases.
Given:
The C-style cast interpretation is valid; however, the direct-initialization is not.
Thus the first sentence conflicts with the latter two under said interpretation.
Furthermore, the parenthetical in the first sentence is meant to be parsed as:
However, it may be taken as:
Suggestion:
Move the latter two sentences under an "Otherwise" bound to the first, with appropriate indentation.
Indent the "then" part of the first as well.
Suggestion:
Improve punctuation within the parenthetical in the first sentence.
The text was updated successfully, but these errors were encountered: