1219820Sjeff! { dg-do compile }
2219820Sjeff!
3219820Sjeff! PR 57285: [OOP] ICE on invalid: "gfc_array_dimen_size(): Bad dimension" due to SIZE intrinsic with invalid dim on CLASS dummy
4219820Sjeff!
5271127Shselasky! Contributed by Lorenz H��depohl <bugs@stellardeath.org>
6219820Sjeff
7219820Sjeff  type type_t
8219820Sjeff  end type
9219820Sjeffcontains
10219820Sjeff  subroutine foo(a)
11219820Sjeff    class(type_t), intent(in) :: a(:)
12219820Sjeff    type(type_t) :: c(size(a,dim=2))   ! { dg-error "is not a valid dimension index" }
13219820Sjeff  end subroutine
14219820Sjeffend
15219820Sjeff