// PR c++/58624 // { dg-do run { target c++11 } } // { dg-add-options tls } // { dg-require-effective-target tls_runtime } int i; template struct A { static thread_local int s; A () { i = s; } }; int f() { return 42; } template thread_local int A::s = f(); int main () { A a; if (i != 42) __builtin_abort(); }