aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/typebound_proc_2.f90
blob: a34d935eb06473ab3516d9b694d6ee6aa418f3a9 (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
25
26
27
28
29
30
31
32
! { dg-do compile }
! { dg-options "-std=f95" }

! Type-bound procedures
! Test that F95 does not allow type-bound procedures

MODULE testmod
  IMPLICIT NONE

  TYPE t
    INTEGER :: x
  CONTAINS ! { dg-error "Fortran 2003" }
    PROCEDURE proc1 ! { dg-error "Fortran 2003" }
    PROCEDURE :: proc2 => p2 ! { dg-error "Fortran 2003" }
  END TYPE t

CONTAINS
  
  SUBROUTINE proc1 (me)
    IMPLICIT NONE
    TYPE(t1) :: me
  END SUBROUTINE proc1

  REAL FUNCTION proc2 (me, x)
    IMPLICIT NONE
    TYPE(t1) :: me
    REAL :: x
    proc2 = x / 2
  END FUNCTION proc2

END MODULE testmod
! { dg-excess-errors "no IMPLICIT type" }