2 ! { dg-options "-Warray-temporaries" }
3 ! Tests the fix for PR80164, in which the compiler segfaulted on this
4 ! when using -Warray-temporaries
6 !******************************************************************************
12 interface assignment(=)
13 module procedure a_to_a
, c_to_a
, a_to_c
15 interface operator(.ne
.)
16 module procedure a_ne_a
20 logical :: l1(4), t
= .true
., f
= .false
.
22 !******************************************************************************
23 elemental
subroutine a_to_a (m
, n
)
24 type(a
), intent(in
) :: n
25 type(a
), intent(out
) :: m
26 m
%b
= len ( trim(n
%c
))
29 elemental
subroutine c_to_a (m
, n
)
30 character(8), intent(in
) :: n
31 type(a
), intent(out
) :: m
35 elemental
subroutine a_to_c (m
, n
)
36 type(a
), intent(in
) :: n
37 character(8), intent(out
) :: m
40 !******************************************************************************
41 elemental
logical function a_ne_a (m
, n
)
42 type(a
), intent(in
) :: n
43 type(a
), intent(in
) :: m
44 a_ne_a
= (m
%b
.ne
. n
%b
) .or
. (m
%c
.ne
. n
%c
)
46 !******************************************************************************
47 elemental
function foo (m
)
49 type(a
), intent(in
) :: m
54 !******************************************************************************
57 x
= (/a (0, "one"),a (0, "two"),a (0, "three"),a (0, "four")/) ! { dg-warning "Creating array temporary" }