This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/58557] [OOP] Issues with CLASS/TYPE functions in array constructors: reject valid, memory leaks, invalid free
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 05 Jan 2014 13:07:17 +0000
- Subject: [Bug fortran/58557] [OOP] Issues with CLASS/TYPE functions in array constructors: reject valid, memory leaks, invalid free
- Auto-submitted: auto-generated
- References: <bug-58557-4 at http dot gcc dot gnu dot org/bugzilla/>
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).