Skip to content

[basic.start.term] “any call to registered functions” involves more than intended #997

Description

@BlowingWind314

Full name of submitter (unless configured in github; will be published with the issue): Yin Xinyu

[basic.start.term]/3 says

... The destruction of a complete object with static storage duration and having constant destruction is sequenced after the destruction of any other complete object with static storage duration and after any call to a function passed to std​::​atexit. ...

It's weird to involve usual calls to registered functions rather than merely calls caused by a call to std::exit. See [basic.start.term]/1

Constructed complete objects with static storage duration are destroyed and functions registered with std​::​atexit are called as part of a call to std​::​exit. The call to std​::​exit is sequenced before the destructions and the registered functions.

Suggested resolution:

Edit [basic.start.term]/3

... The destruction of a complete object with static storage duration and having constant destruction is sequenced after the destruction of any other complete object with static storage duration and after any call to aregistered functions caused by a call to std::exit passed to std​::​atexit. ...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions