aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2020-08-25 17:46:13 +0200
committerTobias Burnus <tobias@codesourcery.com>2020-08-25 17:46:41 +0200
commit3d5ed337cb354c2f85a9caf60377bad887b18d53 (patch)
tree1f1fbb20cd42c8e5c8e77d63f3116ae91a23f4cb /gcc/c
parent24f2764521d8f27760f03f626a4f20f4c82b7c73 (diff)
downloadgcc-3d5ed337cb354c2f85a9caf60377bad887b18d53.zip
gcc-3d5ed337cb354c2f85a9caf60377bad887b18d53.tar.gz
gcc-3d5ed337cb354c2f85a9caf60377bad887b18d53.tar.bz2
OpenMP: Improve map-clause error message for array function parameter (PR96678)
gcc/c/ChangeLog: PR c/96678 * c-typeck.c (handle_omp_array_sections_1): Talk about array function parameter in the error message. gcc/cp/ChangeLog: PR c/96678 * semantics.c (handle_omp_array_sections_1): Talk about array function parameter in the error message. gcc/testsuite/ChangeLog: PR c/96678 * c-c++-common/gomp/map-4.c: New test. * c-c++-common/gomp/depend-1.c: Update dg-error. * c-c++-common/gomp/map-1.c: Likewise. * c-c++-common/gomp/reduction-1.c: Likewise. * g++.dg/gomp/depend-1.C: Likewise. * g++.dg/gomp/depend-2.C: Likewise.
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/c-typeck.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 0d639b60..e158d23 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -13298,8 +13298,13 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
{
if (length == NULL_TREE)
{
- error_at (OMP_CLAUSE_LOCATION (c),
- "for pointer type length expression must be specified");
+ if (C_ARRAY_PARAMETER (ret))
+ error_at (OMP_CLAUSE_LOCATION (c),
+ "for array function parameter length expression "
+ "must be specified");
+ else
+ error_at (OMP_CLAUSE_LOCATION (c),
+ "for pointer type length expression must be specified");
return error_mark_node;
}
if (length != NULL_TREE