view gcc/testsuite/gfortran.dg/class_57.f90 @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { dg-do compile }
!
! PR 59502: [OOP] ICE on invalid on pointer assignment to non-pointer CLASS
!
! Contributed by Andrew Benson <abensonca@gmail.com>

  implicit none

  type :: d
  end type

  type :: p
    class(d) :: cc   ! { dg-error "must be allocatable or pointer" }
  end type

contains

  function pc(pd)
    type(p) :: pc
    class(d), intent(in), target :: pd
    pc%cc => pd   ! { dg-error "is not a member of" }
  end function

end