Fix compilation failure with C++98 compilers
[official-gcc.git] / gcc / testsuite / gfortran.dg / string_array_constructor_1.f90
bloba5968fb37a2668a0edd008e9dd108faed7f96c4f
1 ! { dg-do compile }
2 ! PR 62242
3 ! Array constructor with an array element whose value is a
4 ! character function that is described in an interface block and which
5 ! has an assumed-length result
6 module gfbug
7 implicit none
8 INTERFACE
9 function UpperCase(string) result(upper)
10 character(*), intent(IN) :: string
11 character(LEN(string)) :: upper
12 end function
13 function f2(string) result(upper)
14 character(*), intent(IN) :: string
15 character(5) :: upper
16 end function
17 END INTERFACE
18 contains
19 subroutine s1
20 character(5) c
21 character(5), dimension(1) :: ca
22 ca = (/f2(c)/) ! This compiles
23 ca = (/Uppercase(c)/) ! This gets an ICE
24 end subroutine
25 end module gfbug