]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Tweak error message for mapped parameters.
authorams <ams@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Jul 2019 16:00:46 +0000 (16:00 +0000)
committerams <ams@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Jul 2019 16:00:46 +0000 (16:00 +0000)
2019-07-05  Andrew Stubbs  <ams@codesourcery.com>

gcc/fortran/
* openmp.c (resolve_omp_clauses): Add custom error messages for
parameters in map clauses.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@273143 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/openmp.c

index a163a1d79198715f1f3888cffa5cbbc01a769828..14ec8451c57773552e6ee4e4bd07cd12a8869966 100644 (file)
@@ -1,3 +1,8 @@
+2019-07-05  Andrew Stubbs  <ams@codesourcery.com>
+
+       * openmp.c (resolve_omp_clauses): Add custom error messages for
+       parameters in map clauses.
+
 2019-07-03  Martin Liska  <mliska@suse.cz>
 
        * check.c (gfc_check_c_funloc): Remove
index 1c7bce6c30000dbf17544b7252c6df1a072d9596..44fcb9db8c6899d5023143b3499ad82422667f77 100644 (file)
@@ -4208,8 +4208,21 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
                  continue;
              }
          }
-       gfc_error ("Object %qs is not a variable at %L", n->sym->name,
-                  &n->where);
+       if (list == OMP_LIST_MAP
+           && n->sym->attr.flavor == FL_PARAMETER)
+         {
+           if (openacc)
+             gfc_error ("Object %qs is not a variable at %L; parameters"
+                        " cannot be and need not be copied", n->sym->name,
+                        &n->where);
+           else
+             gfc_error ("Object %qs is not a variable at %L; parameters"
+                        " cannot be and need not be mapped", n->sym->name,
+                        &n->where);
+         }
+       else
+         gfc_error ("Object %qs is not a variable at %L", n->sym->name,
+                    &n->where);
       }
 
   for (list = 0; list < OMP_LIST_NUM; list++)