1! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
2module m
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.
7!
8! R741 proc-component-def-stmt ->
9!        PROCEDURE ( [proc-interface] ) , proc-component-attr-spec-list
10!          :: proc-decl-list
11!  proc-component-attr-spec values are:
12!    PUBLIC, PRIVATE, NOPASS, PASS, POINTER
13
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  contains
28    procedure :: noPassProc
29    procedure :: passProc
30    procedure :: passNopassProc
31    procedure :: publicProc
32    procedure :: privateProc
33  end type procComponentType
34
35contains
36    subroutine publicProc(arg)
37      class(procComponentType) :: arg
38    end
39    subroutine privateProc(arg)
40      class(procComponentType) :: arg
41    end
42    subroutine noPassProc(arg)
43      class(procComponentType) :: arg
44    end
45    subroutine passProc(arg)
46      class(procComponentType) :: arg
47    end
48    subroutine passNopassProc(arg)
49      class(procComponentType) :: arg
50    end
51    subroutine pointerProc(arg)
52      class(procComponentType) :: arg
53    end
54end module m
55