C ++静态与线程存储持续时间销毁顺序

c++ static vs thread storage duration destruction order

考虑在 c++ 中如何有这两个存储持续时间(以及其他):static storage duration and thread storage duration..

接下来考虑这段代码:

static MyClassA a;
thread_local static MyClassB b;

另外假设"a"和"b"可能不在同一个编译单元中。我 "believe" "b" 的析构函数将在 "a" 之前调用,因为线程存储持续时间将首先终止,只有在完成后静态存储持续时间才会终止并调用 "a" 的析构函数=18=]。我一直在寻找对此的标准参考,但一直找不到。有人可以通过权威来源具体确认这一点吗?

[basic.start.term]/p1:

Destructors for initialized objects with thread storage duration within a given thread are called as a result of returning from the initial function of that thread and as a result of that thread calling std::exit. The completions of the destructors for all initialized objects with thread storage duration within that thread are sequenced before the initiation of the destructors of any object with static storage duration.