OSDN Git Service

PR debug/43329
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / private_type_9.f90
1 ! { dg-do compile }
2 ! { dg-options "-std=f95" }
3 !
4 ! PR fortran/33106
5 !
6 module m1
7   implicit none
8   type, private :: t
9     integer :: i
10   end type t
11   type(t), public :: one ! { dg-error "PRIVATE derived type" }
12   type(t), public, parameter :: two = t(2) ! { dg-error "PRIVATE derived type" }
13 end module m1
14
15 module m2
16   implicit none
17   private
18   type t
19     integer :: i
20   end type t
21   type(t), public :: one ! { dg-error "PRIVATE derived type" }
22   type(t), public, parameter :: two = t(2) ! { dg-error "PRIVATE derived type" }
23 end module m2
24
25 module m3
26   implicit none
27   type t
28     integer :: i
29   end type t
30 end module m3
31
32 module m4
33   use m3!, only: t
34   implicit none
35   private 
36   private :: t
37   type(t), public :: one
38   type(t), public, parameter :: two = t(2)
39 end module m4
40
41 end
42 ! { dg-final { cleanup-modules "m1 m2 m3 m4" } }