------- Comment #1 from burnus at gcc dot gnu dot org  2010-02-28 10:18 -------
Possibly related:
  implicit none
  type, abstract :: parent
    integer :: i
  end type

  type, extends(parent) :: child
  end type
  type(child) :: c1, c1a
  class(child), allocatable :: c2
  print *, c1%parent%i
  print *, c2%parent%i
  c1a%parent = c1%parent !<<< LHS & RHS invalid
  c1a%parent = c2%parent !<<< LHS invalid
end

Here, c1a%parent and c1%parent is clearly invalid according to C613; for the
rest - I don't know. See also PR 43193. It boils down to understand what makes
data-ref polymorphic - maybe my renewed interpretation of PR 43193 is wrong and
the patch in PR 43193 is still correct?!?

R612  data-ref  is  part-ref % part-ref
R613  part-ref  is  part-name [ ( section-subscript-list ) ]
C611  (R612) If the rightmost part-name is of abstract type, data-ref shall be
polymorphic.

If one finally understands what exactly is meant by this, one should add a
proper error message to  gfc_match_varspec, which saves one of having the check
all over the place.


-- 


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

Reply via email to