3 ! Tests fix for PR28425 in which anything other than a constructor would
4 ! not work for derived type components in a structure constructor.
6 ! Original version sent by Vivek Rao on 18 Jan 06
7 ! Modified by Steve Kargl to remove IO
31 type(date_m
), parameter :: christmas
= date_m (12)
35 xx
= file_info(date_m(-1)) ! This always worked - a constructor
36 if (xx
%date
%month
/= -1) call abort
38 xx
= file_info(dat
) ! This was the original PR - a variable
39 if (xx
%date
%month
/= 1) call abort
41 xx
= file_info(foo(2)) ! ...functions were also broken
42 if (xx
%date
%month
/= 2) call abort
44 xx
= file_info(christmas
) ! ...and parameters
45 if (xx
%date
%month
/= 12) call abort
50 function foo (i
) result (ans
)
57 ! { dg-final { cleanup-modules "foo_mod" } }