This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, fortran] PR31154 , PR31229 and PR33334 - use associated or imported function characteristics.


> That's because the testcase is in error:-)

I did not have time yet to build gfortran with the new patch,
but what does it do with the following code:

type(foo) function ext_fun()
  type foo
    sequence
    integer :: i
  end type foo
  ext_fun%i = 1
end function ext_fun

end 

that is accepted by xlf (sequence required) and g95 (with/without sequence),
but gives with the previous patch:

derived_function_interface_1_red.f90:6.2:

  ext_fun%i = 1
 1
Error: Unclassifiable statement at (1)
derived_function_interface_1_red.f90:1:

type(foo) function ext_fun()
1
Error: The type for function 'ext_fun' at (1) is not accessible

Note that without sequence xlf issues the following error:

An external FUNCTION of derived type must be of a sequence derived type or of a derived type which is use associated.

is g95 wrong to ignore that? if yes, will gfortran catch it?

Dominique


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]