Debian Codegraph @

gcc/testsuite/gfortran.dg/use_only_5.f90

raw
1 ! { dg-do compile }
2 !
3 ! PR fortran/39427
4 !
5 ! Test case was failing with the initial version of the
6 ! constructor patch.
7 !
8 ! Based on the Fortran XML library FoX
9
10 module m_common_attrs
11 implicit none
12 private
13
14 type dict_item
15 integer, allocatable :: i(:)
16 end type dict_item
17
18 type dictionary_t
19 private
20 type(dict_item), pointer :: d => null()
21 end type dictionary_t
22
23 public :: dictionary_t
24 public :: get_prefix_by_index
25
26 contains
27 pure function get_prefix_by_index(dict) result(prefix)
28 type(dictionary_t), intent(in) :: dict
29 character(len=size(dict%d%i)) :: prefix
30 end function get_prefix_by_index
31 end module m_common_attrs
32
33 module m_common_namespaces
34 use m_common_attrs, only: dictionary_t
35 use m_common_attrs, only: get_prefix_by_index
36 end module m_common_namespaces