[Bug fortran/91513] New: Non-standard terminology in error message for pointer component assignment in pure procedure

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug fortran/91513] New: Non-standard terminology in error message for pointer component assignment in pure procedure

marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91513

            Bug ID: 91513
           Summary: Non-standard terminology in error message for pointer
                    component assignment in pure procedure
           Product: gcc
           Version: 8.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: damian at sourceryinstitute dot org
  Target Milestone: ---

Based on a quick search, I don't think the Fortran standard uses the term
"impure variable," which makes it difficult to interpret the error message
below.  Above the GCC source code that contains this error message is a
citation to Fortran 2008 C1283. It might be nice to have a more descriptive
error message or at least to a comment to the GCC source that more fully
explains how the constraint is being applied to lead to the error message
below:

$cat impure-variable.f90
  implicit none
  type ptr
    logical, pointer :: bool=>null()
  end type
  type(ptr) :: foo, bar
  bar = f(foo)
contains
  pure function f(x) result(y)
    type(ptr), intent(in) :: x
    type(ptr) y
    y = x
  end function
end
$gfortran-8 impure-variable.f90
impure-variable.f90:11:8:

     y = x
        1
Error: The impure variable at (1) is assigned to a derived type variable with a
POINTER component in a PURE procedure (12.6)
$gfortran-8 --version
Reply | Threaded
Open this post in threaded view
|

[Bug fortran/91513] Non-standard terminology in error message for pointer component assignment in pure procedure

marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91513

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P5
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-09-16
     Ever confirmed|0                           |1
           Severity|normal                      |enhancement

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
I confirm the error message from at least 4.8 up to trunk (10.0).

Could you please suggest a better message?
Reply | Threaded
Open this post in threaded view
|

[Bug fortran/91513] Non-standard terminology in error message for pointer component assignment in pure procedure

marxin at gcc dot gnu.org
In reply to this post by marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91513

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |kargl at gcc dot gnu.org

--- Comment #2 from kargl at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #1)
> I confirm the error message from at least 4.8 up to trunk (10.0).
>
> Could you please suggest a better message?

Damian and I worked on an improvement, and have
developed a patch. Need to pull patch off my
laptop and send to Damian for review.
Reply | Threaded
Open this post in threaded view
|

[Bug fortran/91513] Non-standard terminology in error message for pointer component assignment in pure procedure

marxin at gcc dot gnu.org
In reply to this post by marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91513

--- Comment #3 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Sun Oct 13 17:16:40 2019
New Revision: 276941

URL: https://gcc.gnu.org/viewcvs?rev=276941&root=gcc&view=rev
Log:
2019-10-13  Damian Rouson  <[hidden email]>

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

2019-10-13  Damian Rouson  <[hidden email]>

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

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/impure_assignment_2.f90
Reply | Threaded
Open this post in threaded view
|

[Bug fortran/91513] Non-standard terminology in error message for pointer component assignment in pure procedure

marxin at gcc dot gnu.org
In reply to this post by marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91513

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |10.0

--- Comment #4 from kargl at gcc dot gnu.org ---
Fixed on trunk. Closing.  Thanks for bug report.
Reply | Threaded
Open this post in threaded view
|

[Bug fortran/91513] Non-standard terminology in error message for pointer component assignment in pure procedure

marxin at gcc dot gnu.org
In reply to this post by marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91513

--- Comment #5 from Damian Rouson <damian at sourceryinstitute dot org> ---
Thanks, Steve!