Consider the example in the section basic.start.dynamic, that is:
// - File 1 -
#include "a.h"
#include "b.h"
B b;
A::A(){
b.Use(); //#1
}
// - File 2 -
#include "a.h"
A a;
// - File 3 -
#include "a.h"
#include "b.h"
extern A a;
extern B b;
int main() {
a.Use(); //#2
b.Use();
}
The comments follow the example are:
If, however, a is initialized at some point after the first statement of main, b will be initialized prior to its use in A::A.
I can't understand why b is guaranteed initialized prior to its use in A::A when a is initialized at some point after the first statement of main. According to what the rule says:
It is implementation-defined whether the dynamic initialization of a non-local non-inline variable with static storage duration is sequenced before the first statement of main or is deferred. If it is deferred, it strongly happens before any non-initialization odr-use of any non-inline function or non-inline variable defined in the same translation unit as the variable to be initialized.
A non-initialization odr-use is an odr-use ([basic.def.odr]) not caused directly or indirectly by the initialization of a non-local static or thread storage duration variable.
What I can understand is that, when the initialization is deferred, the variable a should be initialized prior to the odr-use(non-initialization odr-use) of the variable a which is at the place marked with #2. However what I can't understand is that, the comment says that b will be initialized prior to its use in A::A. IIUC, the invocation of function A::A is as a part of initialization of the variable a, hence the odr-use of the variable b at #1 is not a non-initialization odr-use due to it is caused directly or indirectly by the initialization of a non-local static or thread storage duration variable. I think it only can say that the variable b is guaranteed to be initialized prior to #2, why the comment says that b will be initialized prior to its use in A::A? How to interpret this example?