1 ! RUN: not %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s
2 ! Test WhyNotDefinable() explanations
5 real, protected
:: prot
10 type(ptype
), protected
:: protptr
21 type(lock_type
) :: lock
28 character(*), parameter :: internal
= '0'
30 subroutine test1(dummy
)
32 integer, parameter :: j3
= 666
33 type(ptype
), intent(in
) :: dummy
36 !CHECK: error: Input variable 'a' is not definable
37 !CHECK: because: 'a' is construct associated with an expression
40 associate (a
=> arr([1])) ! vector subscript
41 !CHECK: error: Input variable 'a' is not definable
42 !CHECK: because: Construct association 'a' has a vector subscript
45 associate (a
=> arr(2:1:-1))
46 read(internal
,*) a
! ok
48 !CHECK: error: Input variable 'j3' is not definable
49 !CHECK: because: '666_4' is not a variable
51 !CHECK: error: Left-hand side of assignment is not definable
52 !CHECK: because: 't2var' is an entity with either an EVENT_TYPE or LOCK_TYPE
55 !CHECK: error: Left-hand side of assignment is not definable
56 !CHECK: because: 'prot' is protected in this scope
59 !CHECK: error: Left-hand side of assignment is not definable
60 !CHECK: because: 'dummy' is an INTENT(IN) dummy argument
64 pure
subroutine test2(ptr
)
65 integer, pointer, intent(in
) :: ptr
66 !CHECK: error: Input variable 'ptr' is not definable
67 !CHECK: because: 'ptr' is externally visible via 'ptr' and not definable in a pure subprogram
70 subroutine test3(objp
, procp
)
71 real, intent(in
), pointer :: objp
72 procedure(sin
), pointer, intent(in
) :: procp
73 !CHECK: error: Actual argument associated with INTENT(IN OUT) dummy argument 'op=' is not definable
74 !CHECK: because: 'objp' is an INTENT(IN) dummy argument
76 !CHECK: error: Actual argument associated with procedure pointer dummy argument 'pp=' may not be INTENT(IN)
80 real, intent(in out
), pointer :: op
83 procedure(sin
), pointer, intent(in out
) :: pp