There seems to be some problems when using __tm_atomic in template class member functions. I got errors whenever I put __tm_atomic regions in those functions. Here's the test case:
#include using namespace std;templateclass Ptr{
private:
T *p;
public:
Ptr(T *x):p(x){}
int Equal(T *q){
__tm_atomic{}
return p==q?1:0;
}
};int main()
{
int a=3;
int *p_a=&a;
Ptr ptr_a(&a);
cout<}
And the error message is:
$ icpc -Qtm_enabled try_atomic.cpptry_atomic.cpp(23): error: expected a "}"try_atomic.cpp(23): internal error: assertion failed at: "shared/edgcpfe/templates.c", line 2897
The code would compile if the class were not a template class. Is it a bug or that I shouldn't use it this way? Thanks.
btw, I'm using the Linux version of prototype edition 2.0



