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

--- Comment #2 from Gavin Ridley <gavin.keith.ridley at gmail dot com> ---
OK, I see, thank you. I believe you're right on that. When I tried to make this
example, I cut out an important part that seems to cause the difference between
gcc compiler versions. This code:

program asdf
  use iso_fortran_env
  implicit none
  real(real64), dimension(:), allocatable :: arr
  allocate(arr(-5:10))
  print *, 'lbound = ', lbound(arr)
  print *, 'ubound = ', ubound(arr)
  call boundprinter(arr)

  contains
    subroutine boundprinter(x)
      class(*), intent(in), dimension(:) :: x
      print *, 'lbound = ', lbound(x)
      print *, 'ubound = ', ubound(x)
    endsubroutine boundprinter
endprogram asdf

Gives the difference I'm looking to illustrate. Insteady of specifying the type
of the array, this instead has the polymorphic class(*) which gives lbound=-5
on gcc 4.9.3 but gives lbound=1 on gcc 7.3.1. Which gcc is correct?

Reply via email to