diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-10-31 19:06:08 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-10-31 19:06:08 +0000 |
commit | 23871d0cedfe77078bb09c3be41afd26e4a9f551 (patch) | |
tree | b855c0f5f2b49779d10067e2ee590fb7d92a9ef8 /gcc/cp/semantics.c | |
parent | 2b2b90a31143f386260cc41a9aeb05f6516c9538 (diff) | |
download | ppe42-gcc-23871d0cedfe77078bb09c3be41afd26e4a9f551.tar.gz ppe42-gcc-23871d0cedfe77078bb09c3be41afd26e4a9f551.zip |
* c-typeck.c (c_finish_omp_clauses): Diagnose aligned clause
with decl that is not pointer nor array.
* semantics.c (finish_omp_clauses): Diagnose aligned clause
with decl that is not pointer nor array nor reference to those.
* g++.dg/gomp/simd-1.C: New test.
* g++.dg/gomp/declare-simd-1.C (f32): Fix up aligned clause argument.
* g++.dg/gomp/declare-simd-2.C (fn13, fn14): Add new tests.
* gcc.dg/gomp/declare-simd-2.c (fn7, fn8, fn9, fn10, fn11): Likewise.
* c-c++-common/gomp/simd6.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204273 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index de3e8e7dcb8..49097f7f1b3 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -5467,6 +5467,19 @@ finish_omp_clauses (tree clauses) error ("%qE is not a variable in %<aligned%> clause", t); remove = true; } + else if (!type_dependent_expression_p (t) + && TREE_CODE (TREE_TYPE (t)) != POINTER_TYPE + && TREE_CODE (TREE_TYPE (t)) != ARRAY_TYPE + && (TREE_CODE (TREE_TYPE (t)) != REFERENCE_TYPE + || (!POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (t))) + && (TREE_CODE (TREE_TYPE (TREE_TYPE (t))) + != ARRAY_TYPE)))) + { + error_at (OMP_CLAUSE_LOCATION (c), + "%qE in %<aligned%> clause is neither a pointer nor " + "an array nor a reference to pointer or array", t); + remove = true; + } else if (bitmap_bit_p (&aligned_head, DECL_UID (t))) { error ("%qD appears more than once in %<aligned%> clauses", t); |