1! { dg-do compile }
2!
3! PR 47349: missing warning: Actual argument contains too few elements
4!
5! Contributed by Janus Weil <janus@gcc.gnu.org>
6
7 implicit none
8 type t
9    integer :: j(3)
10 end type t
11
12 type(t) :: tt
13 integer :: i(3) = (/ 1,2,3 /)
14
15 tt%j = i
16
17 call sub1 (i)     ! { dg-error "Actual argument contains too few elements" }
18 call sub1 (tt%j)  ! { dg-error "Actual argument contains too few elements" }
19 call sub2 (i)     ! { dg-error "Rank mismatch in argument" }
20 call sub2 (tt%j)  ! { dg-error "Rank mismatch in argument" }
21
22contains
23
24  subroutine sub1(i)
25    integer, dimension(1:3,1:3) :: i
26    print *,"sub1:",i
27  end subroutine
28
29  subroutine sub2(i)
30    integer, dimension(:,:) :: i
31    print *,"sub2:",i
32  end subroutine
33
34end
35