[stmt.jump.general] (original) (raw)

8 Statements [stmt]

8.8 Jump statements [stmt.jump]

8.8.1 General [stmt.jump.general]

Jump statements unconditionally transfer control.

[Note 1:

On exit from a scope (however accomplished), objects with automatic storage duration that have been constructed in that scope are destroyed in the reverse order of their construction ([stmt.dcl]).

However, the program can be terminated (by callingstd​::​exit() orstd​::​abort() ([support.start.term]), for example) without destroying objects with automatic storage duration.

— _end note_]

[Note 2:

A suspension of a coroutine ([expr.await]) is not considered to be an exit from a scope.

— _end note_]