2018-09-30 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / typebound_proc_24.f03
blobe8ed9186f40202f0c680ccf6dd1cbb78e2175625
1 ! { dg-do compile }
3 ! PR 49112: [4.6/4.7 Regression] [OOP] Missing type-bound procedure, "duplicate save" warnings and internal compiler error
5 ! Contributed by John <jwmwalrus@gmail.com>
7 module datetime_mod
9   implicit none
11   type :: DateTime
12     integer :: year, month, day
13   contains
14     procedure :: getFormattedString
15   end type
17   type(DateTime) :: ISO_REFERENCE_DATE = DateTime(1875, 5, 20)
19 contains
21   character function getFormattedString(dt)
22     class(DateTime) :: dt
23   end function
25   subroutine test
26     type(DateTime) :: dt
27     print *,dt%getFormattedString()
28   end subroutine
30 end module