view gcc/testsuite/gfortran.dg/specification_type_resolution_2.f90 @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { dg-do compile }
! Tests the fix for PR30283 in which the type of the result
! of bar was getting lost

! Contributed by Harald Anlauf <anlauf@gmx.de>

module gfcbug50
  implicit none
contains

  subroutine foo (n, y)
    integer, intent(in)         :: n
    integer, dimension(bar (n)) :: y
    ! Array bound is specification expression, which is allowed (F2003, sect.7.1.6)
  end subroutine foo

  pure function bar (n) result (l)
    integer, intent(in) :: n
    integer             :: l
    l = n
  end function bar

end module gfcbug50