File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 3131};
3232
3333X* make_x() {
34- // The call to std::malloc can not implicitly create an object of type X
35- // because X is not an implicit-lifetime class.
34+ // The call to \tcode { std::malloc} can not implicitly create an object of type \tcode {X}
35+ // because \tcode {X} is not an implicit-lifetime class.
3636 X* p = (X*)std::malloc(sizeof(struct X));
3737 p->a = 1; // undefined behavior, no set of objects give us defined behavior
3838 return p;
289289
290290\pnum
291291\ubxref {basic.start.main.exit.during.destruction } \\
292- If std::exit is called to
292+ If \tcode { std::exit} is called to
293293end a program during the destruction of an object with static or thread storage duration, the program has
294294undefined behavior.
295295
305305Exiter ex; //
306306
307307int main() {}
308- // Undefined behavior when destructor of static variable ex is called it will call std::exit
308+ // undefined behavior when destructor of static variable \tcode {ex} is called it will call \tcode { std::exit}
309309\end {codeblock }
310310\end {example }
311311
339339B b;
340340
341341int main() {}
342- // Undefined behavior, static objects are destructed in reverse order, in this case a then b and
343- // finally c . When the destructor of c is call it calls f() which passes through definition of
342+ // undefined behavior, static objects are destructed in reverse order, in this case \tcode {a} then \tcode {b} and
343+ // finally \tcode {c} . When the destructor of \tcode {c} is called, it calls \tcode { f()} which passes through the definition of
344344// previously destroyed block-scope object
345345\end {codeblock }
346346\end {example }
You can’t perform that action at this time.
0 commit comments