1! RUN: %S/test_errors.sh %s %t %f18 2subroutine s1(x, y) 3 !ERROR: Array pointer 'x' must have deferred shape or assumed rank 4 real, pointer :: x(1:) ! C832 5 !ERROR: Allocatable array 'y' must have deferred shape or assumed rank 6 real, dimension(1:,1:), allocatable :: y ! C832 7end 8 9subroutine s2(a, b, c) 10 real :: a(:,1:) 11 real :: b(10,*) 12 real :: c(..) 13 !ERROR: Array pointer 'd' must have deferred shape or assumed rank 14 real, pointer :: d(:,1:) ! C832 15 !ERROR: Allocatable array 'e' must have deferred shape or assumed rank 16 real, allocatable :: e(10,*) ! C832 17 !ERROR: Assumed-rank array 'f' must be a dummy argument 18 real, pointer :: f(..) ! C837 19 !ERROR: Assumed-shape array 'g' must be a dummy argument 20 real :: g(:,1:) 21 !ERROR: Assumed-size array 'h' must be a dummy argument 22 real :: h(10,*) ! C833 23 !ERROR: Assumed-rank array 'i' must be a dummy argument 24 real :: i(..) ! C837 25end 26 27subroutine s3(a, b) 28 real :: a(*) 29 !ERROR: Dummy array argument 'b' may not have implied shape 30 real :: b(*,*) ! C836 31 !ERROR: Implied-shape array 'c' must be a named constant 32 real :: c(*) ! C836 33 !ERROR: Named constant 'd' array must have constant or implied shape 34 integer, parameter :: d(:) = [1, 2, 3] 35end 36 37subroutine s4() 38 type :: t 39 integer, allocatable :: a(:) 40 !ERROR: Component array 'b' without ALLOCATABLE or POINTER attribute must have explicit shape 41 integer :: b(:) ! C749 42 real, dimension(1:10) :: c 43 !ERROR: Array pointer component 'd' must have deferred shape 44 real, pointer, dimension(1:10) :: d ! C745 45 end type 46end 47 48function f() 49 !ERROR: Array 'f' without ALLOCATABLE or POINTER attribute must have explicit shape 50 real, dimension(:) :: f ! C832 51end 52 53subroutine s5() 54 !ERROR: Allocatable array 'a' must have deferred shape or assumed rank 55 integer :: a(10), b(:) 56 allocatable :: a 57 allocatable :: b 58end subroutine 59