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/46299] New: Diagnose specification expressions involving host-associated vars with deferred bounds


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

           Summary: Diagnose specification expressions involving
                    host-associated vars with deferred bounds
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


Crayftn diagnoses the following error while gfortran, NAG, g95 and ifort accept
the program. My gut feeling is that cray is right, but I have not checked it.
Maybe it also has changed between F95/F2003/F2008.

    integer :: x(size(A))
                      ^
ftn-812 crayftn: ERROR FOO, File = diag.f90, Line = 5, Column = 23
  Object "A" is an argument to inquiry intrinsic "SIZE" in a declaration
expression.  Its array bounds must not be deferred.


Using the example
!---------------
integer, allocatable :: a(:)
contains
  subroutine foo(x)
    integer :: x(size(A))
  end subroutine
end
!---------------

If one changes "a" to "integer :: a(4)" it compiles without any error.


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