* semantics.c (finish_omp_threadprivate): Call complete_type.

From-SVN: r192812
This commit is contained in:
Jason Merrill 2012-10-25 11:53:40 -04:00 committed by Jason Merrill
parent 4514a96b2a
commit 57c3feb40a
4 changed files with 18 additions and 1 deletions

View File

@ -1,5 +1,7 @@
2012-10-25 Jason Merrill <jason@redhat.com>
* semantics.c (finish_omp_threadprivate): Call complete_type.
* class.c (one_inherited_ctor): Warn about variadic inherited ctor.
2012-10-25 Marc Glisse <marc.glisse@inria.fr>

View File

@ -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)

View File

@ -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;

View File

@ -1,3 +1,5 @@
// { dg-require-alias }
extern "C" void abort();
struct A