1 ! RUN: not %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s
2 ! Test WhyNotModifiable() 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' must be definable
37 !CHECK: 'a' is construct associated with an expression
40 associate (a
=> arr([1])) ! vector subscript
41 !CHECK: error: Input variable 'a' must be definable
42 !CHECK: 'a' is construct associated with an expression
45 associate (a
=> arr(2:1:-1))
46 read(internal
,*) a
! ok
48 !CHECK: error: Input variable 'j3' must be definable
49 !CHECK: '666_4' is not a variable
51 !CHECK: error: Left-hand side of assignment is not modifiable
52 !CHECK: 't2var' is an entity with either an EVENT_TYPE or LOCK_TYPE
55 !CHECK: error: Left-hand side of assignment is not modifiable
56 !CHECK: 'prot' is protected in this scope
59 !CHECK: error: Left-hand side of assignment is not modifiable
60 !CHECK: 'dummy' is an INTENT(IN) dummy argument
64 pure
subroutine test2(ptr
)
65 integer, pointer, intent(in
) :: ptr
66 !CHECK: error: Input variable 'ptr' must be definable
67 !CHECK: 'ptr' is externally visible and referenced in a pure procedure