re PR fortran/91513 (Non-standard terminology in error message for pointer component...
authorDamian Rouson <damian@sourceryinstitute.org>
Sun, 13 Oct 2019 17:16:40 +0000 (17:16 +0000)
committerSteven G. Kargl <kargl@gcc.gnu.org>
Sun, 13 Oct 2019 17:16:40 +0000 (17:16 +0000)
2019-10-13  Damian Rouson  <damain@sourceryinstitue.org>

PR fortran/91513
* resolve.c (resolve_ordinary_assign): Improved error message.

2019-10-13  Damian Rouson  <damain@sourceryinstitue.org>

PR fortran/91513
* gfortran.dg/impure_assignment_2.f90: Update dg-error regex.

From-SVN: r276941

gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/impure_assignment_2.f90

index e215763a862920999fc37da28edc2d81856d0ada..2892011b740e48c5113bed3dc1591cb6f8f98ab5 100644 (file)
@@ -1,3 +1,8 @@
+2019-10-13  Damian Rouson  <damain@sourceryinstitue.org>
+
+       PR fortran/91513
+       * resolve.c (resolve_ordinary_assign): Improved error message.
+
 2019-10-13  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/90297
index 10da8f9a00d9b188e5a4b281336569277cfa1210..93f2d0aa7612c74a10998b394cb721e9c9a40086 100644 (file)
@@ -10769,9 +10769,12 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns)
                        "component in a PURE procedure",
                        &rhs->where);
          else
-           gfc_error ("The impure variable at %L is assigned to "
-                       "a derived type variable with a POINTER "
-                       "component in a PURE procedure (12.6)",
+         /* F2008, C1283 (4).  */
+           gfc_error ("In a pure subprogram an INTENT(IN) dummy argument "
+                       "shall not be used as the expr at %L of an intrinsic "
+                       "assignment statement in which the variable is of a "
+                       "derived type if the derived type has a pointer "
+                       "component at any level of component selection.",
                        &rhs->where);
          return rval;
        }
index b914cb8fd42f47f3a9847bfe823c032bc0384045..eca8cc6e44dabde8490642c7df9ecb225ec34666 100644 (file)
@@ -1,3 +1,8 @@
+2019-10-13  Damian Rouson  <damain@sourceryinstitue.org>
+
+       PR fortran/91513
+       * gfortran.dg/impure_assignment_2.f90: Update dg-error regex.
+
 2019-10-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/92017
index 38d841d7a5d9a4aab2e9863ac2138fb08347a5c9..1c1da4b9ee3b6d2a319e42a22cdd9ee898140e0b 100644 (file)
@@ -40,7 +40,7 @@ CONTAINS
   PURE FUNCTION give_next3(node)
      TYPE(node_type), intent(in) :: node
      TYPE(node_type) :: give_next
-     give_next = node ! { dg-error "impure variable" }
+     give_next = node ! { dg-error "pure subprogram" }
   END FUNCTION
 END MODULE pr20863