This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/66944] ICE on static thread_local member in class template
- From: "jason.vas.dias at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 21 Jun 2017 23:13:40 +0000
- Subject: [Bug c++/66944] ICE on static thread_local member in class template
- Auto-submitted: auto-generated
- References: <bug-66944-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66944
--- Comment #7 from Jason Vas Dias <jason.vas.dias at gmail dot com> ---
And there is no workaround, really - one cannot initialize a
C++ class object member of a static thread_local C++ template class object
member in one place, outside the class, and use that same object in a
non-static member function of the template class,
and instantiate another instance of the same template (with different
parameters) in the same translation unit - re-declaration in each
using member function allows compilation to succeed, but just hides
the static class member, so you can't actually use the single initialized
static member in a non-static member function.
So you HAVE to access thread_local static class members ONLY through pointers ?
I will try this.