1 ! RUN: %python %S/test_errors.py %s %flang_fc1
3 ! The passed-object dummy argument shall be a scalar, nonpointer, nonallocatable
4 ! dummy data object with the same declared type as the type being defined;
5 ! all of its length type parameters shall be assumed; it shall be polymorphic
6 ! (7.3.2.3) if and only if the type being defined is extensible (7.5.7).
7 ! It shall not have the VALUE attribute.
9 ! C757 If the procedure pointer component has an implicit interface or has no
10 ! arguments, NOPASS shall be specified.
12 ! C758 If PASS (arg-name) appears, the interface of the procedure pointer
13 ! component shall have a dummy argument named arg-name.
18 procedure(real), pointer, nopass
:: a
19 !ERROR: Procedure component 'b' must have NOPASS attribute or explicit interface
20 procedure(real), pointer :: b
26 !ERROR: Procedure component 'a' with no dummy arguments must have NOPASS attribute
27 procedure(s1
), pointer :: a
28 !ERROR: Procedure component 'b' with no dummy arguments must have NOPASS attribute
29 procedure(s1
), pointer, pass
:: b
31 !ERROR: Procedure binding 'p1' with no dummy arguments must have NOPASS attribute
33 !ERROR: Procedure binding 'p2' with no dummy arguments must have NOPASS attribute
34 procedure
, pass
:: p2
=> s1
43 !ERROR: 'y' is not a dummy argument of procedure interface 's'
44 procedure(s
), pointer, pass(y
) :: a
46 !ERROR: 'z' is not a dummy argument of procedure interface 's'
47 procedure
, pass(z
) :: p
=> s
57 !ERROR: Passed-object dummy argument 'x' of procedure 'a' may not have the POINTER attribute
58 procedure(s1
), pointer :: a
59 !ERROR: Passed-object dummy argument 'x' of procedure 'b' may not have the ALLOCATABLE attribute
60 procedure(s2
), pointer, pass(x
) :: b
61 !ERROR: Passed-object dummy argument 'f' of procedure 'c' must be a data object
62 procedure(s3
), pointer, pass
:: c
63 !ERROR: Passed-object dummy argument 'x' of procedure 'd' must be scalar
64 procedure(s4
), pointer, pass
:: d
68 class(t
), pointer :: x
72 !ERROR: The type of 'x' has already been declared
73 class(t
), allocatable
:: x
89 !ERROR: Passed-object dummy argument 'x' of procedure 'a' must be of type 't1' but is 'REAL(4)'
90 procedure(s
), pointer :: a
94 !ERROR: Passed-object dummy argument 'y' of procedure 's' must be of type 't2' but is 'TYPE(t1)'
95 procedure
, pass(y
) :: s
108 !ERROR: Passed-object dummy argument 'x' of procedure 'a' has non-assumed length parameter 'l'
109 procedure(s1
), pointer :: a
119 sequence
! t is not extensible
120 !ERROR: Passed-object dummy argument 'x' of procedure 'a' may not be polymorphic because 't' is not extensible
121 procedure(s
), pointer :: a
125 !ERROR: Non-extensible derived type 't' may not be used with CLASS keyword
133 !ERROR: Passed-object dummy argument 'x' of procedure 's' must be polymorphic because 't' is extensible
138 type(t
) :: x
! x is not polymorphic