Debian Codegraph @

gcc/testsuite/gfortran.dg/coarray_25.f90

raw
1 ! { dg-do compile }
2 ! { dg-options "-fcoarray=single" }
3 !
4 ! Used to be rejected with:
5 ! Error: Variable 'x' at (1) is a coarray or has a coarray
6 ! component and is not ALLOCATABLE, SAVE nor a dummy argument
7 !
8 ! Is valid as "a" is allocatable, cf. C526
9 ! and http://j3-fortran.org/pipermail/j3/2011-June/004403.html
10 !
11
12 subroutine test2()
13 type t
14 integer, allocatable :: a(:)[:]
15 end type t
16 type(t) :: x
17 allocate(x%a(1)[*])
18 end subroutine test2