cpp/language/constinit


 * - asserts that a variable has static initialization, i.e. and, otherwise the program is ill-formed.

Explanation
The specifier declares a variable with static or thread. If a variable is declared with, its must be applied with. If a variable declared with has  (even if it is ), the program is ill-formed. If no declaration is reachable at the point of the initializing declaration, the program is ill-formed, no diagnostic required.

cannot be used together with or. When the declared variable is a reference, is equivalent to. When the declared variable is an object, mandates that the object must have static initialization and constant destruction and makes the object const-qualified, however,  does not mandate constant destruction and const-qualification. As a result, an object of a type which has constexpr constructors and no constexpr destructor (e.g. ) might be declared with but not.

can also be used in a non-initializing declaration to tell the compiler that a variable is already initialized,  that would otherwise be incurred by a hidden guard variable.