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

--- Comment #62 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-06-21 
07:34:52 UTC ---
(In reply to comment #61)
> > FAIL: gfortran.dg/coarray_lock_3.f90  -O   (test for errors, line 72)
> The following reduced code does not give the expected error:
>   lock(lock[1]) ! { dg-error "must be a scalar coarray of type LOCK_TYPE" } !

Thanks for the report. There are three bugs:

a) The code is valid and there should be no dg-error. Seemingly, I forget to
apply the update patch for that file.

b) The wording of the error message is wrong. As the error message correctly
states, "lock[1]" is *not* a coarray - but no coarray is required. Being
coindexed or being the component of a coarray is also sufficient.

c) "LOCK(a%lock)" in the following example is valid, but it is rejected:

use iso_fortran_env
implicit none
type t
  type(lock_type) :: lock
end type t

type t2
  type(lock_type), allocatable :: lock(:)[:]
end type t2

type(t) :: a[*]
type(t2) :: b

allocate(b%lock(1)[*])
LOCK(a%lock)    ! FAILS
LOCK(a[1]%lock)

LOCK(b%lock(1))
LOCK(b%lock(1)[1])
end

Reply via email to