summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0371-PR-c-49223.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0371-PR-c-49223.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0371-PR-c-49223.patch99
1 files changed, 99 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0371-PR-c-49223.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0371-PR-c-49223.patch
new file mode 100644
index 0000000000..45e2320b71
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0371-PR-c-49223.patch
@@ -0,0 +1,99 @@
1From 2be264baf4367b63b7cb88bf3d7cb5c687d91c28 Mon Sep 17 00:00:00 2001
2From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Mon, 30 May 2011 12:18:59 +0000
4Subject: [PATCH] PR c++/49223
5 * semantics.c (finish_omp_clauses): Call require_complete_type
6 even for copyin/copyprivate clauses. Only call
7 cxx_omp_create_clause_info if inner_type is COMPLETE_TYPE_P.
8
9 * g++.dg/gomp/pr49223-1.C: New test.
10 * g++.dg/gomp/pr49223-2.C: New test.
11
12
13git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174433 138bc75d-0d04-0410-961f-82ee72b054a4
14
15index cfd6cf0..d56423e 100644
16--- a/gcc/cp/semantics.c
17+++ b/gcc/cp/semantics.c
18@@ -3945,12 +3945,13 @@ finish_omp_clauses (tree clauses)
19 break;
20 }
21
22- if (need_complete_non_reference)
23+ if (need_complete_non_reference || need_copy_assignment)
24 {
25 t = require_complete_type (t);
26 if (t == error_mark_node)
27 remove = true;
28- else if (TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE)
29+ else if (TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE
30+ && need_complete_non_reference)
31 {
32 error ("%qE has reference type for %qs", t, name);
33 remove = true;
34@@ -3992,6 +3993,7 @@ finish_omp_clauses (tree clauses)
35 Save the results, because later we won't be in the right context
36 for making these queries. */
37 if (CLASS_TYPE_P (inner_type)
38+ && COMPLETE_TYPE_P (inner_type)
39 && (need_default_ctor || need_copy_ctor || need_copy_assignment)
40 && !type_dependent_expression_p (t)
41 && cxx_omp_create_clause_info (c, inner_type, need_default_ctor,
42new file mode 100644
43index 0000000..307210f
44--- /dev/null
45+++ b/gcc/testsuite/g++.dg/gomp/pr49223-1.C
46@@ -0,0 +1,28 @@
47+// PR c++/49223
48+// { dg-do compile }
49+// { dg-options "-fopenmp" }
50+
51+template <int N>
52+struct V
53+{
54+ V () {}
55+ ~V () {}
56+};
57+
58+template <int N>
59+struct S
60+{
61+ void foo ()
62+ {
63+ V <0> v;
64+ #pragma omp parallel private (v)
65+ ;
66+ }
67+};
68+
69+void
70+bar (void)
71+{
72+ S <0> s;
73+ s.foo ();
74+}
75diff --git a/gcc/testsuite/g++.dg/gomp/pr49223-2.C b/gcc/testsuite/g++.dg/gomp/pr49223-2.C
76new file mode 100644
77index 0000000..9539773
78--- /dev/null
79+++ b/gcc/testsuite/g++.dg/gomp/pr49223-2.C
80@@ -0,0 +1,16 @@
81+// PR c++/49223
82+// { dg-do compile }
83+// { dg-require-effective-target tls }
84+// { dg-options "-fopenmp" }
85+
86+struct S; // { dg-error "forward declaration" }
87+extern __thread struct S s; // { dg-error "has incomplete type" }
88+struct T;
89+extern __thread struct T t;
90+
91+void
92+foo ()
93+{
94+ #pragma omp parallel copyin (s)
95+ ;
96+}
97--
981.7.0.4
99