annotate gcc/testsuite/gfortran.dg/elemental_initializer_1.f90 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do compile }
kono
parents:
diff changeset
2 ! Tests the fix for elemental functions not being allowed in
kono
parents:
diff changeset
3 ! specification expressions in pure procedures.
kono
parents:
diff changeset
4 !
kono
parents:
diff changeset
5 ! Testcase from iso_varying_string by Rich Townsend <rhdt@star.ucl.ac.uk>
kono
parents:
diff changeset
6 ! The allocatable component has been changed to a pointer for this testcase.
kono
parents:
diff changeset
7 !
kono
parents:
diff changeset
8 module iso_varying_string
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 type varying_string
kono
parents:
diff changeset
11 private
kono
parents:
diff changeset
12 character(LEN=1), dimension(:), pointer :: chars
kono
parents:
diff changeset
13 end type varying_string
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 interface len
kono
parents:
diff changeset
16 module procedure len_
kono
parents:
diff changeset
17 end interface len
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 contains
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 pure function char_auto (string) result (char_string)
kono
parents:
diff changeset
22 type(varying_string), intent(in) :: string
kono
parents:
diff changeset
23 character(LEN=len(string)) :: char_string ! Error was here
kono
parents:
diff changeset
24 char_string = ""
kono
parents:
diff changeset
25 end function char_auto
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 elemental function len_ (string) result (length)
kono
parents:
diff changeset
28 type(varying_string), intent(in) :: string
kono
parents:
diff changeset
29 integer :: length
kono
parents:
diff changeset
30 length = 1
kono
parents:
diff changeset
31 end function len_
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 end module iso_varying_string