File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 396
396
constructed, but not yet destroyed,
397
397
since the try block was entered.
398
398
If an exception is thrown during the destruction of temporaries or
399
- local variables for a \keyword {return} statement\iref {stmt.return },
399
+ variables for a \keyword {return} statement\iref {stmt.return },
400
400
the destructor for the returned object (if any) is also invoked.
401
401
The objects are destroyed in the reverse order of the completion
402
402
of their construction.
418
418
}
419
419
\end {codeblock }
420
420
At \# 1, the returned object of type \tcode {A} is constructed.
421
- Then, the local variable \tcode {b} is destroyed\iref {stmt.jump }.
422
- Next, the local variable \tcode {y} is destroyed,
421
+ Then, the variable \tcode {b} is destroyed\iref {stmt.jump }.
422
+ Next, the variable \tcode {y} is destroyed,
423
423
causing stack unwinding,
424
424
resulting in the destruction of the returned object,
425
- followed by the destruction of the local variable \tcode {a}.
425
+ followed by the destruction of the variable \tcode {a}.
426
426
Finally, the returned object is constructed again at \# 2.
427
427
\end {example }
428
428
You can’t perform that action at this time.
0 commit comments