1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
3 ! Test 8.5.10 & 8.5.18 constraints on dummy argument declarations
8 real, allocatable
:: a(:)[:]
10 type, extends(hasCoarray
) :: extendsHasCoarray
15 type, extends(hasCoarray2
) :: extendsHasCoarray2
18 real, allocatable
:: coarray(:)[:]
23 real, allocatable
, intent(out
) :: x(:)
25 subroutine s01b
! C846 - can only be caught at a call via explicit interface
26 !ERROR: ALLOCATABLE coarray 'coarray' may not be associated with INTENT(OUT) dummy argument 'x='
27 !ERROR: ALLOCATABLE dummy argument 'x=' has corank 0 but actual argument has corank 1
31 subroutine s02(x
) ! C846
32 !ERROR: An INTENT(OUT) dummy argument may not be, or contain, an ALLOCATABLE coarray
33 type(hasCoarray
), intent(out
) :: x
36 subroutine s03(x
) ! C846
37 !ERROR: An INTENT(OUT) dummy argument may not be, or contain, an ALLOCATABLE coarray
38 type(extendsHasCoarray
), intent(out
) :: x
41 subroutine s04(x
) ! C846
42 !ERROR: An INTENT(OUT) dummy argument may not be, or contain, an ALLOCATABLE coarray
43 type(hasCoarray2
), intent(out
) :: x
46 subroutine s05(x
) ! C846
47 !ERROR: An INTENT(OUT) dummy argument may not be, or contain, an ALLOCATABLE coarray
48 type(extendsHasCoarray2
), intent(out
) :: x
53 subroutine s06(x
) ! C847
54 use ISO_FORTRAN_ENV
, only
: lock_type
55 !ERROR: An INTENT(OUT) dummy argument may not be, or contain, EVENT_TYPE or LOCK_TYPE
56 type(lock_type
), intent(out
) :: x
59 subroutine s07(x
) ! C847
60 use ISO_FORTRAN_ENV
, only
: event_type
61 !ERROR: An INTENT(OUT) dummy argument may not be, or contain, EVENT_TYPE or LOCK_TYPE
62 type(event_type
), intent(out
) :: x