aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/private_type_6.f90
blob: e980cb9690775d4cc2dc4f1ce78f874678cd3745 (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
! { dg-do compile }
! PR fortran/32460
!
module foomod
  implicit none
  type :: footype
    private
    integer :: dummy
  end type footype
  TYPE :: bartype
    integer :: dummy
    integer, private :: dummy2
  end type bartype
end module foomod

program foo_test
  USE foomod
  implicit none
  TYPE(footype) :: foo
  TYPE(bartype) :: foo2
  foo  = footype(1) ! { dg-error "is a PRIVATE component" }
  foo2 = bartype(1,2) ! { dg-error "is a PRIVATE component" }
  foo2%dummy2 = 5 ! { dg-error "is a PRIVATE component" }
end program foo_test