Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
20 Views

error compiling: using __thread with template class static variable

Hi,

The following compiles fine under gcc 3.4 and 4.2, but fails under Intel compiler 11.0. Any insights? Thanks.

tls_test.h:
template
class tls_test
{
static __thread int i;
};

template
__thread int tls_test::i = -1;

tls_test.cpp:
#include "tls_test.h"
tls_test<2> t;

Compiler output:
$/apps/intel/Compiler/11.0/069/bin/intel64/icpc -c tls_test.cpp
tls_test.h(10): error: template argument list must match the parameter list
__thread int tls_test::i = -1;

Also tried Intel compiler 11.1 (icpc (ICC) 11.1 20090630), same result.

0 Kudos
1 Reply
Highlighted
New Contributor II
20 Views

11.0 latest does not fix the problem.

11.1 latest fix the problem.

You should not test with such old compiler version like 20090630 ..

please try latest 11.1 version
0 Kudos