From 57c3feb40a875ec85620513b49c758c6076a289a Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Thu, 25 Oct 2012 11:53:40 -0400 Subject: [PATCH] * semantics.c (finish_omp_threadprivate): Call complete_type. From-SVN: r192812 --- gcc/cp/ChangeLog | 2 ++ gcc/cp/semantics.c | 2 +- gcc/testsuite/g++.dg/gomp/tls-template1.C | 13 +++++++++++++ libgomp/testsuite/libgomp.c++/tls-init1.C | 2 ++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/gomp/tls-template1.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 38e79f58e6e..278a668964d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,7 @@ 2012-10-25 Jason Merrill + * semantics.c (finish_omp_threadprivate): Call complete_type. + * class.c (one_inherited_ctor): Warn about variadic inherited ctor. 2012-10-25 Marc Glisse diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 63b364c37de..073ee97be9c 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -4360,7 +4360,7 @@ finish_omp_threadprivate (tree vars) error ("%qE declared % after first use", v); else if (! TREE_STATIC (v) && ! DECL_EXTERNAL (v)) error ("automatic variable %qE cannot be %", v); - else if (! COMPLETE_TYPE_P (TREE_TYPE (v))) + else if (! COMPLETE_TYPE_P (complete_type (TREE_TYPE (v)))) error ("% %qE has incomplete type", v); else if (TREE_STATIC (v) && TYPE_P (CP_DECL_CONTEXT (v)) && CP_DECL_CONTEXT (v) != current_class_type) diff --git a/gcc/testsuite/g++.dg/gomp/tls-template1.C b/gcc/testsuite/g++.dg/gomp/tls-template1.C new file mode 100644 index 00000000000..5865ce3d98e --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/tls-template1.C @@ -0,0 +1,13 @@ +// { dg-require-effective-target tls } + +template struct B +{ + T t; +}; + +class A { + static B b; +#pragma omp threadprivate(b) +}; + +B A::b; diff --git a/libgomp/testsuite/libgomp.c++/tls-init1.C b/libgomp/testsuite/libgomp.c++/tls-init1.C index 4cbaccb9851..d62e96b95bf 100644 --- a/libgomp/testsuite/libgomp.c++/tls-init1.C +++ b/libgomp/testsuite/libgomp.c++/tls-init1.C @@ -1,3 +1,5 @@ +// { dg-require-alias } + extern "C" void abort(); struct A