diff options
author | James Norris <jnorris@codesourcery.com> | 2016-02-16 15:29:04 +0000 |
---|---|---|
committer | James Norris <jnorris@gcc.gnu.org> | 2016-02-16 15:29:04 +0000 |
commit | ba539195610794575f76e8dd2e16f548c4f89dbb (patch) | |
tree | ed6777959d63b9ec1c9b695fcc1d2726804b56d8 /gcc/cp/semantics.c | |
parent | 2a2b8f64889632aed99c358fbfddb10ab8774242 (diff) | |
download | gcc-ba539195610794575f76e8dd2e16f548c4f89dbb.zip gcc-ba539195610794575f76e8dd2e16f548c4f89dbb.tar.gz gcc-ba539195610794575f76e8dd2e16f548c4f89dbb.tar.bz2 |
re PR c/64748 (OpenACC: "is not a variable" error with deviceptr())
PR c/64748
gcc/c/
* c-parser.c (c_parser_oacc_data_clause_deviceptr): Allow parms.
gcc/cp/
* parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
* semantics.c (finish_omp_clauses): Add deviceptr checking.
gcc/testsuite/
* c-c++-common/goacc/deviceptr-1.c: Add tests.
* g++.dg/goacc/deviceptr-1.c: New file.
From-SVN: r233458
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 0f6a6b5..70a7aa5 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -6635,6 +6635,14 @@ finish_omp_clauses (tree clauses, bool allow_fields, bool declare_simd) remove = true; } else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP + && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_FORCE_DEVICEPTR + && !type_dependent_expression_p (t) + && !POINTER_TYPE_P (TREE_TYPE (t))) + { + error ("%qD is not a pointer variable", t); + remove = true; + } + else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_FIRSTPRIVATE_POINTER) { if (bitmap_bit_p (&generic_head, DECL_UID (t)) |