xref: /llvm-project/flang/test/Semantics/call29.f90 (revision faa1338ccdc5dc980dcf241eb380c27e24d3865a)
1! RUN: %python %S/test_errors.py %s %flang_fc1
2
3module m
4  type t1
5    integer, allocatable :: a(:)
6  end type
7  type t2
8    integer :: n = 123
9  end type
10  type t3
11   contains
12    final :: t3final
13  end type
14  type t4
15    type(t1) :: c1
16    type(t2) :: c2
17    type(t3) :: c3
18  end type
19  type t5
20  end type
21 contains
22  elemental subroutine t3final(x)
23    type(t3), intent(in) :: x
24  end subroutine
25  subroutine test1(x1,x2,x3,x4,x5)
26    !ERROR: An INTENT(OUT) assumed-size dummy argument array may not have a derived type with any default component initialization
27    type(t1), intent(out) :: x1(*)
28    !ERROR: An INTENT(OUT) assumed-size dummy argument array may not have a derived type with any default component initialization
29    type(t2), intent(out) :: x2(*)
30    !ERROR: An INTENT(OUT) assumed-size dummy argument array may not be finalizable
31    type(t3), intent(out) :: x3(*)
32    !ERROR: An INTENT(OUT) assumed-size dummy argument array may not have a derived type with any default component initialization
33    !ERROR: An INTENT(OUT) assumed-size dummy argument array may not be finalizable
34    type(t4), intent(out) :: x4(*)
35    !ERROR: An INTENT(OUT) assumed-size dummy argument array may not be polymorphic
36    class(t5), intent(out) :: x5(*)
37  end subroutine
38end module
39