* semantics.c (finish_omp_threadprivate): Call complete_type.
From-SVN: r192812
This commit is contained in:
parent
4514a96b2a
commit
57c3feb40a
@ -1,5 +1,7 @@
|
|||||||
2012-10-25 Jason Merrill <jason@redhat.com>
|
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.
|
* class.c (one_inherited_ctor): Warn about variadic inherited ctor.
|
||||||
|
|
||||||
2012-10-25 Marc Glisse <marc.glisse@inria.fr>
|
2012-10-25 Marc Glisse <marc.glisse@inria.fr>
|
||||||
|
@ -4360,7 +4360,7 @@ finish_omp_threadprivate (tree vars)
|
|||||||
error ("%qE declared %<threadprivate%> after first use", v);
|
error ("%qE declared %<threadprivate%> after first use", v);
|
||||||
else if (! TREE_STATIC (v) && ! DECL_EXTERNAL (v))
|
else if (! TREE_STATIC (v) && ! DECL_EXTERNAL (v))
|
||||||
error ("automatic variable %qE cannot be %<threadprivate%>", 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);
|
error ("%<threadprivate%> %qE has incomplete type", v);
|
||||||
else if (TREE_STATIC (v) && TYPE_P (CP_DECL_CONTEXT (v))
|
else if (TREE_STATIC (v) && TYPE_P (CP_DECL_CONTEXT (v))
|
||||||
&& CP_DECL_CONTEXT (v) != current_class_type)
|
&& CP_DECL_CONTEXT (v) != current_class_type)
|
||||||
|
13
gcc/testsuite/g++.dg/gomp/tls-template1.C
Normal file
13
gcc/testsuite/g++.dg/gomp/tls-template1.C
Normal 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;
|
@ -1,3 +1,5 @@
|
|||||||
|
// { dg-require-alias }
|
||||||
|
|
||||||
extern "C" void abort();
|
extern "C" void abort();
|
||||||
|
|
||||||
struct A
|
struct A
|
||||||
|
Loading…
Reference in New Issue
Block a user