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
We're inconsistent in how we format/word comments in examples for ill-formed and undefined behavior code. The following cases show a few of the variations used:
utilities.tex:any_cast<string&>(y); // error; cannot
g<int>(0); // error, substituting parameter type instantiates \tcode{A<int>}
S<char> s1; // error: no matching constructor
template<> enum A<char>::E : char { echar }; // ill-formed, \tcode{A<char>::E} was instantiated
struct Inner2; // ill-formed, no diagnostic required
// ill-formed, no diagnostic required: the two expressions are functionally equivalent but not equivalent
void A<Y>::B<double>::mf2() { } // ill-formed; \tcode{B<double>} is specialized but
template<class T> void f(T::R); // ill-formed (no diagnostic required), attempt to declare
p->x.j = 99; // undefined: modifies a const subobject
int m = g(false); // undefined behavior due to access of \tcode{x.n} outside its lifetime
C().C::~C(); // undefined behavior: temporary of type \tcode{C} destroyed twice
pb->f(); // undefined behavior, lifetime of \tcode{*pb} has ended
Suggestion: Change all to either of the following as appropriate:
I don't think "undefined behavior" has much benefit over "undefined" in this context.
Although it's widely used in examples, strictly speaking "error" doesn't mean anything, those cases are ill-formed. Do we want to continue using "error" to clearly distinguish those from the "ill-formed, no diagnostic required" cases?
jensmaurer
changed the title
Inconsistentcies in comments for ill-formed/undefined behavior examples
Inconsistencies in comments for ill-formed/undefined behavior examples
Aug 6, 2019
Editorial teleconference: "undefined" -> "undefined behavior", use colon afterwards if the actual reason follows. Replace "ill-formed: explanation" with "error: explanation". Use "ill-formed, no diagnostic required: explanation". Use colon where it explains why the thing before the colon. Otherwise, leave unchanged for now.
jensmaurer
added
big
An issue causing a large set of changes, scattered across most of the text.
and removed
decision-required
A decision of the editorial group (or the Project Editor) is required.
labels
Sep 30, 2019
We're inconsistent in how we format/word comments in examples for ill-formed and undefined behavior code. The following cases show a few of the variations used:
Suggestion: Change all to either of the following as appropriate:
where
: <explanation>
can be omitted if it is clear from the surrounding text.This does not apply in compatibility.tex, where we should stick with:
f(u8"text"); // ill-formed; previously well-formed
The text was updated successfully, but these errors were encountered: