1 ! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
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 !WARNING: PRIVATE should not appear more than once in derived type components
54 !WARNING: SEQUENCE should not appear more than once in derived type components
60 !ERROR: A sequence type may not have the EXTENDS attribute
61 type, extends(t1a
) :: t2
68 !ERROR: A sequence type may not have a CONTAINS statement
71 !WARNING: A sequence type should have at least one component
84 !ERROR: A sequence type data component must either be of an intrinsic type or a derived sequence type
85 class(*), allocatable
:: typeStarField
86 !ERROR: A sequence type data component must either be of an intrinsic type or a derived sequence type
87 type(plainType
) :: testField1
88 !WARNING: A sequence type data component that is a pointer to a non-sequence type is not standard
89 type(plainType
), pointer :: testField1p
90 type(sequenceType
) :: testField2
91 procedure(real), pointer, nopass
:: procField
93 !ERROR: A sequence type may not have type parameters
94 type :: paramType(param
)
95 integer, kind
:: param
102 !ERROR: PRIVATE is only allowed in a derived type that is in a module
105 !ERROR: PRIVATE is only allowed in a derived type that is in a module