1 ! RUN: %python %S/test_errors.py %s %flang_fc1
3 ! C755 The same proc-component-attr-spec shall not appear more than once in a
4 ! given proc-component-def-stmt.
5 ! C759 PASS and NOPASS shall not both appear in the same
6 ! proc-component-attr-spec-list.
8 ! R741 proc-component-def-stmt ->
9 ! PROCEDURE ( [proc-interface] ) , proc-component-attr-spec-list
11 ! proc-component-attr-spec values are:
12 ! PUBLIC, PRIVATE, NOPASS, PASS, POINTER
14 type :: procComponentType
15 !WARNING: Attribute 'PUBLIC' cannot be used more than once
16 procedure(publicProc
), public
, pointer, public
:: publicField
17 !WARNING: Attribute 'PRIVATE' cannot be used more than once
18 procedure(privateProc
), private
, pointer, private
:: privateField
19 !WARNING: Attribute 'NOPASS' cannot be used more than once
20 procedure(nopassProc
), nopass
, pointer, nopass
:: noPassField
21 !WARNING: Attribute 'PASS' cannot be used more than once
22 procedure(passProc
), pass
, pointer, pass
:: passField
23 !ERROR: Attributes 'PASS' and 'NOPASS' conflict with each other
24 procedure(passNopassProc
), pass
, pointer, nopass
:: passNopassField
25 !WARNING: Attribute 'POINTER' cannot be used more than once
26 procedure(pointerProc
), pointer, public
, pointer :: pointerField
27 !ERROR: Procedure component 'nonpointerfield' must have POINTER attribute
28 procedure(publicProc
), public
:: nonpointerField
30 procedure
:: noPassProc
32 procedure
:: passNopassProc
33 procedure
:: publicProc
34 procedure
:: privateProc
35 end type procComponentType
38 subroutine publicProc(arg
)
39 class(procComponentType
) :: arg
41 subroutine privateProc(arg
)
42 class(procComponentType
) :: arg
44 subroutine noPassProc(arg
)
45 class(procComponentType
) :: arg
47 subroutine passProc(arg
)
48 class(procComponentType
) :: arg
50 subroutine passNopassProc(arg
)
51 class(procComponentType
) :: arg
53 subroutine pointerProc(arg
)
54 class(procComponentType
) :: arg