This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/58557] [OOP] Issues with CLASS/TYPE functions in array constructors: reject valid, memory leaks, invalid free


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58557

--- Comment #2 from janus at gcc dot gnu.org ---
I think the conversion errors are simply due to declaration issues in the test
case, e.g.:

program main
  implicit none

   type t
   end type t

  interface
    function f_type_na()
      import :: t
      type(t) :: f_type
    end function
  end interface

  type(t) :: b

  b = f_type_na()

end program


  b = f_type_na()
      1
Error: Can't convert REAL(4) to TYPE(t) at (1)


But the following variant yields a different error:

program main
  implicit none

   type t
   end type t

  type(t) :: b

  b = f_type_na()

contains

  function f_type_na()
    type(t) :: f_type
  end function

end program


  function f_type_na()
  1
Error: Contained function 'f_type_na' at (1) has no IMPLICIT type
c0.f90:11.6:

  b = f_type_na()
      1
Error: Can't convert UNKNOWN to TYPE(t) at (1)



Apparently we apply implicit typing to the INTERFACE version (although IMPLICIT
NONE is given).


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