}
QualType ExprType = VD->getType().getNonReferenceType();
- ExprResult DE = BuildDeclRefExpr(VD, ExprType, VK_RValue, Id.getLoc());
- DSAStack->addDSA(VD, cast<DeclRefExpr>(DE.get()), OMPC_threadprivate);
+ ExprResult DE = BuildDeclRefExpr(VD, ExprType, VK_LValue, Id.getLoc());
return DE;
}
}
Vars.push_back(*I);
+ DSAStack->addDSA(VD, DE, OMPC_threadprivate);
}
OMPThreadPrivateDecl *D = 0;
if (!Vars.empty()) {
#pragma omp threadprivate(d, b)
// CHECK-NEXT: #pragma omp threadprivate(d,b)
+template <class T>
+struct ST {
+ static T m;
+ #pragma omp threadprivate(m)
+};
+
template <class T> T foo() {
static T v;
#pragma omp threadprivate(v)
+ v = ST<T>::m;
return v;
}
//CHECK: template <class T = int> int foo() {