1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Forward references to derived types (error cases)
3 ! C732 A parent-type-name shall be the name of a previously defined
4 ! extensible type (7.5.7).
6 !ERROR: The derived type 'undef' was forward-referenced but not defined
7 type(undef
) function f1()
11 !ERROR: The derived type 'undef' was forward-referenced but not defined
12 type(undef
) function f2() result(r
)
16 !ERROR: The derived type 'undefpdt' was forward-referenced but not defined
17 type(undefpdt(1)) function f3()
21 !ERROR: The derived type 'undefpdt' was forward-referenced but not defined
22 type(undefpdt(1)) function f4() result(r
)
26 !ERROR: 'bad' is not the name of a parameter for derived type 'pdt'
27 type(pdt(bad
=1)) function f5()
29 integer, kind
:: good
= kind(0)
30 integer(kind
=good
) :: n
35 !ERROR: The derived type 'undef' was forward-referenced but not defined
36 implicit type(undef
)(q
)
40 !ERROR: The derived type 'undefpdt' was forward-referenced but not defined
41 implicit type(undefpdt(1))(q
)
46 !ERROR: Derived type 'undef' not found
53 !ERROR: Derived type 'undefpdt' not found
54 type(undefpdt(1)) :: x
59 !ERROR: Derived type 'undef' not found
64 !ERROR: Derived type 'undefpdt' not found
65 type(undefpdt(1)) :: x
69 !ERROR: Derived type 'undef' not found
70 type, extends(undef
) :: t
76 !ERROR: Cannot construct value for derived type 't2' before it is defined
85 Type(t(3)), pointer :: y
87 !ERROR: Cannot construct value for derived type 't' before it is defined
88 Integer :: nn
= Size(Transfer(t(3)(666),[0]))
90 integer, kind
:: n
= 3
96 !ERROR: The derived type 'undef' has not been defined
97 type(undef
), pointer :: y