summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/class_32.f90
blob: b5857c1f645c53fdea7aca582d7a590fc6bbb0f7 (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
33
34
35
36
37
38
39
40
41
! { dg-do compile }
!
! PR 45827: [4.6 Regression] [OOP] mio_component_ref(): Component not found
!
! Contributed by Daniel Franke <dfranke@gcc.gnu.org>

MODULE m

  TYPE, ABSTRACT :: t
    PRIVATE
    INTEGER   :: n
  CONTAINS
    PROCEDURE :: get
  END TYPE

  ABSTRACT INTERFACE
    SUBROUTINE create(this)
      IMPORT t
      CLASS(t) :: this
    END SUBROUTINE
  END INTERFACE

CONTAINS

  FUNCTION get(this)
    CLASS(t) :: this
    REAL, DIMENSION(this%n) :: get
  END FUNCTION

  SUBROUTINE destroy(this)
    CLASS(t) :: this
  END SUBROUTINE

END MODULE


PROGRAM p
  USE m
END

! { dg-final { cleanup-modules "m" } }