1! { dg-do compile }
2! { dg-options "-std=f95" }
3!
4! PR 39692: f95: conflict between EXTERNAL and POINTER
5!
6! Test for Procedure Pointers (without PROCEDURE statements) with the -std=f95 flag.
7!
8! Contributed by Janus Weil <janus@gcc.gnu.org>
9
10pointer :: f
11external :: f   ! { dg-error "Fortran 2003: Procedure pointer" }
12
13external :: g
14pointer :: g   ! { dg-error "Fortran 2003: Procedure pointer" }
15
16real, pointer, external :: h   ! { dg-error "Fortran 2003: Procedure pointer" }
17
18interface
19  subroutine i
20  end subroutine i
21end interface
22pointer :: i   ! { dg-error "Fortran 2003: Procedure pointer" }
23
24pointer :: j
25interface
26  real function j()
27  end function j   ! { dg-error "Fortran 2003: Procedure pointer" }
28end interface
29
30contains
31
32  function k()   ! { dg-error "attribute conflicts with" }
33    intrinsic sin
34    external k
35    pointer k   ! { dg-error "Fortran 2003: Procedure pointer" }
36    real k
37  end function k
38
39end
40
41