This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/46299] New: Diagnose specification expressions involving host-associated vars with deferred bounds
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 4 Nov 2010 08:37:14 +0000
- Subject: [Bug fortran/46299] New: Diagnose specification expressions involving host-associated vars with deferred bounds
- Auto-submitted: auto-generated
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.