[Bug fortran/35951] New: Unexpected erro "Expected another dimension in array declaration"
john dot young at jrc dot co dot jp
gcc-bugzilla@gcc.gnu.org
Wed Apr 16 01:51:00 GMT 2008
The below code produces the error "Expected another dimension in array
declaration at 1". It only seems to occur when the passed argument that
contains the array dimension is a derived type and not an integer. Also, it
only occurs when the derived-type declaration is below (not above) the
declaration of the array. When the dimension is an integer and not a
derived-type component, either order compiles correctly. I tested on g95 and
intel and obtained no error.
My system is WindowsXP, cygwin, and gcc version 4.3.0 20080212 (experimental)
[trunk revision 132252]
John
!==========================================
module test_module
implicit none
type tt
integer :: n
end type tt
contains
!=======================================================================
!=======================================================================
subroutine test_sub_1(z,t)
implicit none
real :: z(t%n) !this order produces compiler error "Expected another dimension
in array declaration at 1"
type (tt) :: t
!type (tt) :: t !this order compiles correctly
!real :: z(t%n)
end subroutine test_sub_1
!=======================================================================
!
subroutine test_sub_2(z,m)
implicit none
real :: z(m) !this order compiles correctly
integer :: m
!integer,intent(in) :: m !this order compiles correctly too
!real, intent(out) :: z(m)
end subroutine test_sub_2
!=======================================================================
!=======================================================================
end module test_module
--
Summary: Unexpected erro "Expected another dimension in array
declaration"
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: john dot young at jrc dot co dot jp
GCC target triplet: i686-pc-cygwin
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35951
More information about the Gcc-bugs
mailing list