1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Error tests for structure constructors.
3 ! Errors caught by expression resolution are tested elsewhere; these are the
4 ! errors meant to be caught by name resolution, as well as acceptable use
6 ! Type parameters are used to make the parses unambiguous.
13 type, extends(type1
) :: type2(k
)
22 subroutine type1arg(x
)
23 type(type1(0)), intent(in
) :: x
24 end subroutine type1arg
25 subroutine type2arg(x
)
26 type(type2(0,0)), intent(in
) :: x
27 end subroutine type2arg
29 call type1arg(type1(0)())
30 call type1arg(type1(0)(1))
31 call type1arg(type1(0)(n
=1))
32 !ERROR: Keyword 'bad=' does not name a component of derived type 'type1'
33 call type1arg(type1(0)(bad
=1))
34 call type2arg(type2(0,0)(n
=1,m
=2))
35 call type2arg(type2(0,0)(m
=2))
36 call type2arg(type2(0,0)(type1
=type1(0)(n
=1),m
=2))
37 call type2arg(type2(0,0)(type1
=type1(0)(),m
=2))
42 !ERROR: No definition found for type parameter 'k'