This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/60702] New: thread_local initialization
- From: "dv.main at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 28 Mar 2014 22:47:47 +0000
- Subject: [Bug c++/60702] New: thread_local initialization
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60702
Bug ID: 60702
Summary: thread_local initialization
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: dv.main at gmail dot com
Created attachment 32480
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32480&action=edit
Gcc verbose output
Invalid thread local object initialization.
Snippet:
#include <iostream>
using namespace std;
struct far {
struct boo {
boo () {
cerr << "bar::boo" << endl;
}
int i = 42;
};
static void baz() {
cerr << far::FOO.i << endl;
}
static thread_local boo FOO;
};
thread_local typename far::boo far::FOO;
int main() {
far f;
cerr << f.FOO.i << endl;
cerr << far::FOO.i << endl;
return 0;
}
Output:
0
bar::boo
42