On Mon, Jan 06, 2014 at 03:53:13PM +1000, Conrad S wrote:
> According to http://gcc.gnu.org/gcc-4.8/cxx0x_status.html
> the keyword "thread_local" is supported in gcc 4.8 when using -std=c++11

Bugs should be reported to http://gcc.gnu.org/bugzilla/

> file foo.hpp:
> class foo {
>   public:
>   inline  foo() {}
>   inline ~foo() {}
>   inline double bar() { return 123.456; }
>   };
> 
> 
> file a.cpp:
> #include "foo.hpp"
> thread_local foo foo_instance;
> 
> 
> file b.cpp:
> #include "foo.hpp"
> extern thread_local foo foo_instance;
> 
> int main(int argc, char** argv) {
>   double bar = foo_instance.bar();
>   return 0;
>   }

Apparently this got fixed/made latent on the trunk by
http://gcc.gnu.org/r199577 , but it isn't clear if that was an intentional
bugfix somewhere; in any case the patch doesn't look to be backportable.

Wonder if the ctor is really trivial it wouldn't be better to treat it as
not needing dynamic initialization, rather than trying to initialize it
dynamically.

So, please file this into bugzilla.

        Jakub

Reply via email to