1! { dg-do compile }
2!
3! PR 86545: ICE in transfer_expr on invalid WRITE statement
4!
5! Contributed by Janus Weil <janus@gcc.gnu.org>
6
7module m
8
9   type tString
10      character(len=:), allocatable :: cs
11   end type
12
13   interface my_trim
14      module procedure trim_string
15   end interface
16
17contains
18
19   elemental function trim_string(self) result(str)
20      type(tString) :: str
21      class(tString), intent(in) :: self
22   end function
23
24end module
25
26
27program p
28   use m
29   type(tString) :: s
30   write(*,*) my_trim(s)   ! { dg-error "cannot have ALLOCATABLE components" }
31end
32