[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gfortran.dg / pointer_init_8.f90
blob8c6bdb2a6a359d9e8b06acd35d74cdfab1a63f07
1 ! { dg-do run }
3 ! PR 57306: [OOP] ICE on valid with class pointer initialization
5 ! Contributed by Andrew Benson <abensonca@gmail.com>
7 module m
8 type :: c
9 end type c
10 type, extends(c) :: d
11 end type d
12 type(c), target :: x
13 type(d), target :: y
14 end module m
16 use m
17 class(c), pointer :: px => x
18 class(c), pointer :: py => y
20 if (.not. associated(px, x)) call abort()
21 if (.not. same_type_as(px, x)) call abort()
22 if (.not. associated(py, y)) call abort()
23 if (.not. same_type_as(py, y)) call abort()
24 end