• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1! RUN: %S/test_errors.sh %s %t %f18
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    !ERROR: Procedure component 'nonpointerfield' must have POINTER attribute
28    procedure(publicProc), public :: nonpointerField
29  contains
30    procedure :: noPassProc
31    procedure :: passProc
32    procedure :: passNopassProc
33    procedure :: publicProc
34    procedure :: privateProc
35  end type procComponentType
36
37contains
38    subroutine publicProc(arg)
39      class(procComponentType) :: arg
40    end
41    subroutine privateProc(arg)
42      class(procComponentType) :: arg
43    end
44    subroutine noPassProc(arg)
45      class(procComponentType) :: arg
46    end
47    subroutine passProc(arg)
48      class(procComponentType) :: arg
49    end
50    subroutine passNopassProc(arg)
51      class(procComponentType) :: arg
52    end
53    subroutine pointerProc(arg)
54      class(procComponentType) :: arg
55    end
56end module m
57