[Bug fortran/86907] New: [9.0 regression] bogus warning "No location in expression near"

juergen.reuter at desy dot de gcc-bugzilla@gcc.gnu.org
Fri Aug 10 03:47:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86907

            Bug ID: 86907
           Summary: [9.0 regression] bogus warning "No location in
                    expression near"
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: juergen.reuter at desy dot de
  Target Milestone: ---

Created attachment 44522
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44522&action=edit
Minimal reproducer for the warning.

In the following example, gfortran from version 9 on (I think 8 was ok) is
issuing a bogus warning: 
gfortran  -c reproducer.f90
reproducer.f90:30:49:

     type(t2), dimension(cmd%n_pass) :: adapt_code
                                                 1
Warning: No location in expression near (1)

This is the code:
module m_1
  type, public :: t1
     private
     character(LEN=1), dimension(:), allocatable :: chars
  end type t1

end module m_1

!!!!!

module m_2
  use m_1, t2 => t1

  type :: t3
     private
     integer :: n_pass = 0
   contains
     procedure :: execute => t3_execute
  end type t3

contains

  function eval_string () result (sval)
    type(t2) :: sval
  end function eval_string

  subroutine t3_execute (cmd)
    class(t3), intent(inout) :: cmd
    !!! Creates a bogus version in gfortran 9.0.0
    type(t2), dimension(cmd%n_pass) :: adapt_code
    integer :: i
    do i = 1, cmd%n_pass
       adapt_code(i) = eval_string ()
    end do
  end subroutine t3_execute

end module m_2


More information about the Gcc-bugs mailing list