(j3.2006) assumed-size poly actual -> non-poly dummy

Aleksandar Donev donev
Thu Jan 27 19:03:31 EST 2011

On 01/27/11 17:30, Aleksandar Donev wrote:
> Then, there should be a rule prohibiting x%parent without any 
> subscript selectors. Surely we have a rule that prohibits this code...
The rule is there somewhere as the Intel compiler catches the bug below 
(Tobias, gfortran 4.4.4 happily compiles the code below!?!). The rule to 
prohibit the problematic code Bill posted (passing a polymorphic 
assumed-size array) should be at exactly the same place, IMO.

program test

    type :: t
       integer :: i
       real :: r
    end type

    type(t) :: x(10)

    call sub1(x)


    subroutine sub1(x)
       type(t) :: x(*)
       call sub2(x%i)
    end subroutine

    subroutine sub2(x)
       integer :: x(*)
    end subroutine

end program

Error: test.f90, line 16: The upper bound shall not be omitted in the 
last dimension of a reference to an assumed size array.   [X]
       call sub2(x%i)


Aleksandar Donev, Assistant Professor of Mathematics
Courant Institute of Mathematical Sciences
Office: 909 Warren Weaver Hall, New York University
E-mail: donev at courant.nyu.edu
Phone: (212) 992-7315; Fax: (212) 995-4121
Mailing address: 251 Mercer St, New York, NY 10012
Web: http://cims.nyu.edu/~donev

More information about the J3 mailing list