aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/private_type_10.f90
blob: b091db4f7f13cd0b6e958259a03bee1d961ab523 (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" }
!
! PR fortran/34438
!
! Check that error is not issued for local, non-module
! variables.
!
! Contributed by Sven Buijssen
!
module demo
  implicit none
  private
  type myint
    integer :: bar = 42
  end type myint
  public :: func
contains
  subroutine func()
    type(myint) :: foo
  end subroutine func
end module demo

module demo2
  implicit none
  private
  type myint
    integer :: bar = 42
  end type myint
  type(myint), save :: foo2 ! { dg-error "of PRIVATE derived type" }
  public :: foo2
end module demo2