[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / call29.f90
blobd8209a6448b8e2461cfa34cc8db211a7236c3cad
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
3 module 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
38 end module