1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! C735 If EXTENDS appears, SEQUENCE shall not appear.
3 ! C738 The same private-or-sequence shall not appear more than once in a
4 ! given derived-type-def .
6 ! C740 If SEQUENCE appears,
7 ! the type shall have at least one component,
8 ! each data component shall be declared to be of an intrinsic type or of a sequence type,
9 ! the derived type shall not have any type parameter,
10 ! and a type-bound-procedure-part shall not appear.
13 !ERROR: 't0' is not a derived type
17 type, extends(t1
) :: t2
19 !ERROR: Derived type 't3' not found
20 type, extends(t3
) :: t4
22 !ERROR: 't0' is not a derived type
23 type, extends(t0
) :: t5
43 !ERROR: Reference to 't0' is ambiguous
44 type, extends(t0
) :: t1
52 private
! not a fatal error
53 sequence
! not a fatal error
58 !ERROR: A sequence type may not have the EXTENDS attribute
59 type, extends(t1a
) :: t2
66 !ERROR: A sequence type may not have a CONTAINS statement
69 !ERROR: A sequence type must have at least one component
82 !ERROR: A sequence type data component must either be of an intrinsic type or a derived sequence type
83 class(*), allocatable
:: typeStarField
84 !ERROR: A sequence type data component must either be of an intrinsic type or a derived sequence type
85 type(plainType
) :: testField1
86 !Pointers are ok as an extension
87 type(plainType
), pointer :: testField1p
88 type(sequenceType
) :: testField2
89 procedure(real), pointer, nopass
:: procField
91 !ERROR: A sequence type may not have type parameters
92 type :: paramType(param
)
93 integer, kind
:: param
100 !ERROR: PRIVATE is only allowed in a derived type that is in a module
103 !ERROR: PRIVATE is only allowed in a derived type that is in a module