aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/class_57.f90
blob: 7256dfc4d2956f77b061e91513b1b2286969e46e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
! { 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 "Non-POINTER in pointer association context" }
  end function

end