This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/13930] New: derived type with intent(in) attribute not accepted
- From: "Mart dot Rentmeester at sci dot kun dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jan 2004 11:37:04 -0000
- Subject: [Bug fortran/13930] New: derived type with intent(in) attribute not accepted
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following program fails to compile: the compiler generates
an error. It is however a compiler error, and not one in the
program as it says.
> gfortran -c x.f95
In file x.f95:25
function f1(f)
1
Error: Can't assign to INTENT(IN) variable 'f' at (1)
module gd
integer :: i = 0
type t
private
integer :: i = 0
end type
contains
!*******************************************************************************
function f2(f)
implicit none
integer, intent(in) :: f
integer :: f2
integer, external :: external_f
f2 = external_f(f)
end function f2
!*******************************************************************************
function f1(f)
implicit none
type(t), intent(in) :: f
integer :: f1
integer, external :: external_f
f1 = external_f(f%i)
end function f1
!*******************************************************************************
end module gd
--
Summary: derived type with intent(in) attribute not accepted
Product: gcc
Version: tree-ssa
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Mart dot Rentmeester at sci dot kun dot nl
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13930