111
|
1 ! { dg-do compile }
|
|
2 ! PR fortran/32323
|
|
3 ! Array sections with vector subscripts are not allowed
|
|
4 ! with dummy arguments which have VOLATILE or INTENT OUT/INOUT
|
|
5 !
|
|
6 ! Contributed by terry@chem.gu.se
|
|
7 !
|
|
8 module mod
|
|
9 implicit none
|
|
10 contains
|
|
11 subroutine aa(v)
|
|
12 integer,dimension(:),volatile::v
|
|
13 write(*,*)size(v)
|
|
14 v=0
|
|
15 end subroutine aa
|
|
16 subroutine bb(v)
|
|
17 integer,dimension(:),intent(out)::v
|
|
18 write(*,*)size(v)
|
|
19 v=0
|
|
20 end subroutine bb
|
|
21 end module mod
|
|
22
|
|
23 program ff
|
|
24 use mod
|
|
25 implicit none
|
|
26 integer,dimension(10)::w
|
|
27 w=1
|
|
28 call aa(w(2:4))
|
|
29 call aa(w((/3,2,1/))) ! { dg-error "vector subscript" }
|
|
30 call bb(w(2:4))
|
|
31 call bb(w((/3,2,1/))) ! { dg-error "vector subscript" }
|
|
32 write(*,*)w
|
|
33 end
|