1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
4 ! The passed-object dummy argument shall be a scalar, nonpointer, nonallocatable
5 ! dummy data object with the same declared type as the type being defined;
6 ! all of its length type parameters shall be assumed; it shall be polymorphic
7 ! (7.3.2.3) if and only if the type being defined is extensible (7.5.7).
8 ! It shall not have the VALUE attribute.
10 ! C757 If the procedure pointer component has an implicit interface or has no
11 ! arguments, NOPASS shall be specified.
13 ! C758 If PASS (arg-name) appears, the interface of the procedure pointer
14 ! component shall have a dummy argument named arg-name.
19 procedure(real), pointer, nopass
:: a
20 !ERROR: Procedure component 'b' must have NOPASS attribute or explicit interface
21 procedure(real), pointer :: b
27 !ERROR: Procedure component 'a' with no dummy arguments must have NOPASS attribute
28 procedure(s1
), pointer :: a
29 !ERROR: Procedure component 'b' with no dummy arguments must have NOPASS attribute
30 procedure(s1
), pointer, pass
:: b
32 !ERROR: Procedure binding 'p1' with no dummy arguments must have NOPASS attribute
34 !ERROR: Procedure binding 'p2' with no dummy arguments must have NOPASS attribute
35 procedure
, pass
:: p2
=> s1
44 !ERROR: 'y' is not a dummy argument of procedure interface 's'
45 procedure(s
), pointer, pass(y
) :: a
47 !ERROR: 'z' is not a dummy argument of procedure interface 's'
48 procedure
, pass(z
) :: p
=> s
58 !ERROR: Passed-object dummy argument 'x' of procedure 'a' may not have the POINTER attribute
59 procedure(s1
), pointer :: a
60 !ERROR: Passed-object dummy argument 'x' of procedure 'b' may not have the ALLOCATABLE attribute
61 procedure(s2
), pointer, pass(x
) :: b
62 !ERROR: Passed-object dummy argument 'f' of procedure 'c' must be a data object
63 procedure(s3
), pointer, pass
:: c
64 !ERROR: Passed-object dummy argument 'x' of procedure 'd' must be scalar
65 procedure(s4
), pointer, pass
:: d
69 class(t
), pointer :: x
73 !ERROR: The type of 'x' has already been declared
74 class(t
), allocatable
:: x
90 !ERROR: Passed-object dummy argument 'x' of procedure 'a' must be of type 't1' but is 'REAL(4)'
91 procedure(s
), pointer :: a
95 !ERROR: Passed-object dummy argument 'y' of procedure 's' must be of type 't2' but is 'TYPE(t1)'
96 procedure
, pass(y
) :: s
109 !ERROR: Passed-object dummy argument 'x' of procedure 'a' has non-assumed length parameter 'l'
110 procedure(s1
), pointer :: a
120 sequence
! t is not extensible
121 !ERROR: Passed-object dummy argument 'x' of procedure 'a' may not be polymorphic because 't' is not extensible
122 procedure(s
), pointer :: a
126 !ERROR: Non-extensible derived type 't' may not be used with CLASS keyword
134 !ERROR: Passed-object dummy argument 'x' of procedure 's' must be polymorphic because 't' is extensible
139 type(t
) :: x
! x is not polymorphic