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/34788] New: Error diagnostic issued passing array element to explicit shape dummy argument


Gfortran version 4.3.0 20080114 (experimental) [trunk revision 131520]
issues a diagnostic

   call b(z(1))
         1
Error: Element of assumed-shaped array passed to dummy argument 'x' at (1)

on the attached program.  This diagnostic is (a) misleading - b is NOT
an assumed-shape array, and (b) incorrect.  I believe the code is
standard conforming Fortran under the provision allowing an array
element to be passed to an array dummy argument.

Gfortran 4.3.0 20071126 (experimental) [trunk revision 130431] compiles
the code without any diagnostic, as do the NAG, g95, ifort, IBM XLF, pathscale,
pgi compilers.

module passtest
integer, dimension(:),allocatable,save :: z
integer, dimension(4) :: t
contains
 subroutine a
   call b(z(1))
   call b(t(1))
 end subroutine a
 subroutine b(x)
   integer, dimension(2) :: x
 end subroutine b
end module passtest


-- 
           Summary: Error diagnostic issued passing array element to
                    explicit shape dummy argument
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: refson dot temp at ntlworld dot com
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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