File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 31
31
};
32
32
33
33
X* 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.
36
36
X* p = (X*)std::malloc(sizeof(struct X));
37
37
p->a = 1; // undefined behavior, no set of objects give us defined behavior
38
38
return p;
289
289
290
290
\pnum
291
291
\ubxref {basic.start.main.exit.during.destruction } \\
292
- If std::exit is called to
292
+ If \tcode { std::exit} is called to
293
293
end a program during the destruction of an object with static or thread storage duration, the program has
294
294
undefined behavior.
295
295
305
305
Exiter ex; //
306
306
307
307
int 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}
309
309
\end {codeblock }
310
310
\end {example }
311
311
339
339
B b;
340
340
341
341
int 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
344
344
// previously destroyed block-scope object
345
345
\end {codeblock }
346
346
\end {example }
You can’t perform that action at this time.
0 commit comments