3 ! PR 46662: [OOP] gfortran accepts "CALL polymorphic%abstract_type%ppc()"
5 ! Contributed by Wolfgang Kilian <kilian@hep.physik.uni-siegen.de>
6 ! cf. http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/a0857fa4a692d518
11 type, abstract
:: base_t
13 procedure(base_write_i
), pointer :: write_procptr
15 procedure
:: write_i
=> base_write_i
18 type, extends (base_t
) :: t
23 subroutine base_write_i (obj
)
24 class (base_t
), intent(in
) :: obj
26 end subroutine base_write_i
37 print *, "Direct printing"
41 print *, "Direct printing via parent"
45 print *, "Printing via TBP"
49 print *, "Printing via parent TBP"
51 call obj
%base_t
%write_i
! { dg-error "is of ABSTRACT type" }
53 print *, "Printing via OBP"
55 obj
%write_procptr
=> base_write_i
56 call obj
%write_procptr
58 print *, "Printing via parent OBP"
60 obj
%base_t
%write_procptr
=> base_write_i
61 call obj
%base_t
%write_procptr
! { dg-error "is of ABSTRACT type" }