Skip to content

Avoid static destructors during program exit - #1471

Open
jwnimmer-tri wants to merge 1 commit into
jbeder:masterfrom
jwnimmer-tri:never_destroyed
Open

Avoid static destructors during program exit#1471
jwnimmer-tri wants to merge 1 commit into
jbeder:masterfrom
jwnimmer-tri:never_destroyed

Conversation

@jwnimmer-tri

@jwnimmer-tri jwnimmer-tri commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Function-local static variables must either be marked constexpr or never_destroyed. Otherwise, their order of destruction during program exit is indeterminate and can lead to undefined behavior.

https://en.cppreference.com/cpp/language/siof
https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables

Function-local static variables must either be marked constexpr or
never_destroyed. Otherwise, their order of destruction during program
exit is indeterminate and can lead to undefined behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant