aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/semantics.cc')
-rw-r--r--gcc/cp/semantics.cc29
1 files changed, 20 insertions, 9 deletions
diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc
index 328de39..d58dd02 100644
--- a/gcc/cp/semantics.cc
+++ b/gcc/cp/semantics.cc
@@ -9448,20 +9448,31 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
error_at (OMP_CLAUSE_LOCATION (c),
"%qD appears more than once in action clauses", t);
remove = true;
+ break;
}
+ bitmap_set_bit (&generic_head, DECL_UID (t));
+ /* FALLTHRU */
+ case OMP_CLAUSE_INTEROP:
if (!processing_template_decl)
{
- if (/* ort == C_ORT_OMP_INTEROP [uncomment for depobj init] */
- !c_omp_interop_t_p (TREE_TYPE (OMP_CLAUSE_DECL (c))))
- error_at (OMP_CLAUSE_LOCATION (c),
- "%qD must be of %<omp_interop_t%>",
- OMP_CLAUSE_DECL (c));
- else if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_USE
+ if (/* (ort == C_ORT_OMP_INTEROP [uncomment for depobj init]
+ || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_INTEROP) && */
+ !c_omp_interop_t_p (TREE_TYPE (OMP_CLAUSE_DECL (c))))
+ {
+ error_at (OMP_CLAUSE_LOCATION (c),
+ "%qD must be of %<omp_interop_t%>",
+ OMP_CLAUSE_DECL (c));
+ remove = true;
+ }
+ else if ((OMP_CLAUSE_CODE (c) == OMP_CLAUSE_INIT
+ || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_DESTROY)
&& TREE_READONLY (OMP_CLAUSE_DECL (c)))
- error_at (OMP_CLAUSE_LOCATION (c),
- "%qD shall not be const", OMP_CLAUSE_DECL (c));
+ {
+ error_at (OMP_CLAUSE_LOCATION (c),
+ "%qD shall not be const", OMP_CLAUSE_DECL (c));
+ remove = true;
+ }
}
- bitmap_set_bit (&generic_head, DECL_UID (t));
pc = &OMP_CLAUSE_CHAIN (c);
break;
default: