Standard wrote: |
---|
3.6.3 Termination [basic.start.term] 1 Destructors (12.4) for initialized objects (that is, objects whose lifetime (3.8) has begun) with static storage duration are called as a result of returning from main and as a result of calling std::exit (18.5). |
Standard wrote: |
---|
3.7.1 Static storage duration [basic.stc.static] 1 All variables which do not have dynamic storage duration, do not have thread storage duration, and are not local have static storage duration. The storage for these entities shall last for the duration of the program (3.6.2, 3.6.3). |