Comments
Patch
commit 055a6956282763467ce0b84776dbb49e89c5a347
Author: Jason Merrill <jason@redhat.com>
Date: Mon Oct 15 11:06:25 2012 -0700
* semantics.c (finish_omp_threadprivate): Call complete_type.
@@ -4360,7 +4360,7 @@ finish_omp_threadprivate (tree vars)
error ("%qE declared %<threadprivate%> after first use", v);
else if (! TREE_STATIC (v) && ! DECL_EXTERNAL (v))
error ("automatic variable %qE cannot be %<threadprivate%>", v);
- else if (! COMPLETE_TYPE_P (TREE_TYPE (v)))
+ else if (! COMPLETE_TYPE_P (complete_type (TREE_TYPE (v))))
error ("%<threadprivate%> %qE has incomplete type", v);
else if (TREE_STATIC (v) && TYPE_P (CP_DECL_CONTEXT (v))
&& CP_DECL_CONTEXT (v) != current_class_type)
new file mode 100644
@@ -0,0 +1,13 @@
+// { dg-require-effective-target tls }
+
+template <class T> struct B
+{
+ T t;
+};
+
+class A {
+ static B<int> b;
+#pragma omp threadprivate(b)
+};
+
+B<int> A::b;
@@ -1,3 +1,5 @@
+// { dg-require-alias }
+
extern "C" void abort();
struct A