From 51a6a4044c9eed53d86b3f79ca5c3c7b87ade39d Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Sun, 13 Oct 2019 17:16:40 +0000 Subject: [PATCH] re PR fortran/91513 (Non-standard terminology in error message for pointer component assignment in pure procedure) 2019-10-13 Damian Rouson PR fortran/91513 * resolve.c (resolve_ordinary_assign): Improved error message. 2019-10-13 Damian Rouson PR fortran/91513 * gfortran.dg/impure_assignment_2.f90: Update dg-error regex. From-SVN: r276941 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/resolve.c | 9 ++++++--- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/impure_assignment_2.f90 | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e215763a862..2892011b740 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2019-10-13 Damian Rouson + + PR fortran/91513 + * resolve.c (resolve_ordinary_assign): Improved error message. + 2019-10-13 Steven G. Kargl PR fortran/90297 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 10da8f9a00d..93f2d0aa761 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b914cb8fd42..eca8cc6e44d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-10-13 Damian Rouson + + PR fortran/91513 + * gfortran.dg/impure_assignment_2.f90: Update dg-error regex. + 2019-10-13 Thomas Koenig PR fortran/92017 diff --git a/gcc/testsuite/gfortran.dg/impure_assignment_2.f90 b/gcc/testsuite/gfortran.dg/impure_assignment_2.f90 index 38d841d7a5d..1c1da4b9ee3 100644 --- a/gcc/testsuite/gfortran.dg/impure_assignment_2.f90 +++ b/gcc/testsuite/gfortran.dg/impure_assignment_2.f90 @@ -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 -- 2.30.2