Fix TLS initialization condition.

This commit is contained in:
Sönke Ludwig 2017-07-16 00:08:07 +02:00
parent 9e390de9bf
commit 719c62d6c9
No known key found for this signature in database
GPG key ID: D95E8DB493EE314C

View file

@ -228,7 +228,7 @@ struct TaskLocal(T)
}
if (m_hasInitValue) {
static if (__traits(compiles, emplace!T(data, m_initValue)))
static if (__traits(compiles, () @trusted { emplace!T(data, m_initValue); } ()))
() @trusted { emplace!T(data, m_initValue); } ();
else assert(false, "Cannot emplace initialization value for type "~T.stringof);
} else () @trusted { emplace!T(data); } ();