1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
3 ! Forward references to derived types (error cases)
4 ! C732 A parent-type-name shall be the name of a previously defined
5 ! extensible type (7.5.7).
7 !ERROR: The derived type 'undef' was forward-referenced but not defined
8 type(undef
) function f1()
12 !ERROR: The derived type 'undef' was forward-referenced but not defined
13 type(undef
) function f2() result(r
)
17 !ERROR: The derived type 'undefpdt' was forward-referenced but not defined
18 type(undefpdt(1)) function f3()
22 !ERROR: The derived type 'undefpdt' was forward-referenced but not defined
23 type(undefpdt(1)) function f4() result(r
)
27 !ERROR: 'bad' is not the name of a parameter for derived type 'pdt'
28 type(pdt(bad
=1)) function f5()
30 integer, kind
:: good
= kind(0)
31 integer(kind
=good
) :: n
36 !ERROR: The derived type 'undef' was forward-referenced but not defined
37 implicit type(undef
)(q
)
41 !ERROR: The derived type 'undefpdt' was forward-referenced but not defined
42 implicit type(undefpdt(1))(q
)
47 !ERROR: Derived type 'undef' not found
54 !ERROR: Derived type 'undefpdt' not found
55 type(undefpdt(1)) :: x
60 !ERROR: Derived type 'undef' not found
65 !ERROR: Derived type 'undefpdt' not found
66 type(undefpdt(1)) :: x
70 !ERROR: Derived type 'undef' not found
71 type, extends(undef
) :: t
77 !ERROR: Cannot construct value for derived type 't2' before it is defined
86 Type(t(3)), pointer :: y
88 !ERROR: Cannot construct value for derived type 't' before it is defined
89 Integer :: nn
= Size(Transfer(t(3)(666),[0]))
91 integer, kind
:: n
= 3
97 !ERROR: The derived type 'undef' has not been defined
98 type(undef
), pointer :: y