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 via email to