3 ! PR39630: Fortran 2003: Procedure pointer components.
5 ! Probing some error messages.
7 ! Contributed by Janus Weil <janus@gcc.gnu.org>
19 procedure(), pointer, nopass
:: ptr1
20 procedure(real), pointer, nopass
:: ptr2
21 procedure(sub
), pointer, nopass
:: ptr3
22 procedure(), pointer, nopass ptr4
! { dg-error "Expected '::'" }
23 procedure(), pointer, nopass
, pointer :: ptr5
! { dg-error "Duplicate" }
24 procedure
, pointer, nopass
:: ptr6
! { dg-error "Syntax error" }
25 procedure(), nopass
:: ptr8
! { dg-error "POINTER attribute is required" }
26 procedure(pp
), pointer, nopass
:: ptr9
! { dg-error "declared in a later PROCEDURE statement" }
31 procedure(aaargh
), pointer, nopass
:: ptr10
! { dg-error "must be explicit" }
34 type,bind(c
) :: bct
! { dg-error "BIND.C. derived type" }
35 procedure(), pointer,nopass
:: ptr
! { dg-error "cannot be a member of|may not be C interoperable" }
38 procedure(sub
), pointer :: pp
42 x
%ptr2
=> x
! { dg-error "Invalid procedure pointer assignment" }
44 x
=> x
%ptr2
! { dg-error "Non-POINTER in pointer association context" }
46 print *, x
%ptr1() ! { dg-error "attribute conflicts with" }
47 call x
%ptr2() ! { dg-error "attribute conflicts with" }
48 print *,x
%ptr3() ! { dg-error "attribute conflicts with" }
50 call x
%y
! { dg-error "Expected type-bound procedure or procedure pointer component" }