<div dir="ltr">On Thu, Aug 22, 2013 at 10:09 AM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">> +  } else if (D->getInstantiatedFromStaticDataMember()) {<br>

> +    // Initializers of static data members of class template specializations are<br>
> +    // not guaranteed to run in any order with respect to the rest of the<br>
> +    // initializers in a TU.  As a consequence, we can put them into their own<br>
> +    // llvm.global_ctors entry.  This should allow GlobalOpt to fire more often.<br>
> +    AddGlobalCtor(Fn);<br>
> +    DelayedCXXInitPosition.erase(D);<br>
<br>
</div>Is there a standard section you can quote or refer to in here?<br></blockquote><div><br></div><div>[basic.start.init] p2, but maybe I have it wrong here:</div><div><div>"Definitions of explicitly specialized class template static data members have ordered initialization. Other class template static data members (i.e., implicitly or explicitly instantiated specializations) have unordered initialization."</div>
</div><div><br></div><div>I guess I should add a test for an explicitly specialized class template, and not an explicitly instantiated class template.</div></div></div></div>