diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-06-16 21:03:05 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-06-16 21:03:05 +0200 |
commit | 283635f9bd93d373b93efc1f6ffdd215f93be5fe (patch) | |
tree | 5e58a24aa0c773a550f62bd0edd6c36e5155b9cc /gcc/cp/semantics.c | |
parent | 4389cf2551f89c0e060479396786f74aae14d3b2 (diff) | |
download | gcc-283635f9bd93d373b93efc1f6ffdd215f93be5fe.zip gcc-283635f9bd93d373b93efc1f6ffdd215f93be5fe.tar.gz gcc-283635f9bd93d373b93efc1f6ffdd215f93be5fe.tar.bz2 |
gimplify.c (gimplify_scan_omp_clauses): Handle COMPONENT_REFs with base of reference to struct.
* gimplify.c (gimplify_scan_omp_clauses): Handle COMPONENT_REFs
with base of reference to struct.
* parser.c (cp_parser_omp_var_list_no_open): Call
convert_from_reference before cp_parser_postfix_dot_deref_expression.
* semantics.c (finish_omp_clauses): Don't ICE when
processing_template_decl when checking for bitfields and unions.
Look through REFERENCE_REF_P as base of COMPONENT_REF.
* testsuite/libgomp.c++/target-20.C: New test.
From-SVN: r237538
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 9b0cff8..4cc5d23 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -6664,7 +6664,8 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort) { if (type_dependent_expression_p (t)) break; - if (DECL_BIT_FIELD (TREE_OPERAND (t, 1))) + if (TREE_CODE (TREE_OPERAND (t, 1)) == FIELD_DECL + && DECL_BIT_FIELD (TREE_OPERAND (t, 1))) { error_at (OMP_CLAUSE_LOCATION (c), "bit-field %qE in %qs clause", @@ -6680,8 +6681,9 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort) } while (TREE_CODE (t) == COMPONENT_REF) { - if (TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) - == UNION_TYPE) + if (TREE_TYPE (TREE_OPERAND (t, 0)) + && (TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) + == UNION_TYPE)) { error_at (OMP_CLAUSE_LOCATION (c), "%qE is a member of a union", t); @@ -6692,6 +6694,8 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort) } if (remove) break; + if (REFERENCE_REF_P (t)) + t = TREE_OPERAND (t, 0); if (VAR_P (t) || TREE_CODE (t) == PARM_DECL) { if (bitmap_bit_p (&map_field_head, DECL_UID (t))) |