aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/typebound_proc_24.f03
blob: e8ed9186f40202f0c680ccf6dd1cbb78e2175625 (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
! { dg-do compile }
!
! PR 49112: [4.6/4.7 Regression] [OOP] Missing type-bound procedure, "duplicate save" warnings and internal compiler error
!
! Contributed by John <jwmwalrus@gmail.com>

module datetime_mod

  implicit none

  type :: DateTime
    integer :: year, month, day
  contains
    procedure :: getFormattedString
  end type

  type(DateTime) :: ISO_REFERENCE_DATE = DateTime(1875, 5, 20)

contains

  character function getFormattedString(dt)
    class(DateTime) :: dt
  end function

  subroutine test
    type(DateTime) :: dt
    print *,dt%getFormattedString()
  end subroutine

end module