[libcxx-commits] [PATCH] D65667: [libcxx] Early-initialize error_category singletons
Marshall Clow via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Aug 5 10:28:49 PDT 2019
mclow.lists added a comment.
> When a handle to an error_category singleton object is used during the termination phase of a program, the destruction of the `error_category` object may have occurred prior to execution of the current destructor or function registered with `atexit`, because the singleton object may have been constructed after the corresponding initialization or call to `atexit`.
This is exactly correct, and that's exactly what http://eel.is/c++draft/basic.start.term#5 says (second sentence):
> If a call to `std::atexit` strongly happens before the completion of the initialization of an object with static storage duration, the call to the destructor for the object is sequenced before the call to the function passed to `std::atexit`.
Repository:
rCXX libc++
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65667/new/
https://reviews.llvm.org/D65667
More information about the libcxx-commits
mailing list