Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gfortran.dg / private_type_3.f90
blobb8fad6626ed0dc7a0232b9569efe9666f8f72780
1 ! { dg-do compile }
2 ! { dg-options "-O0" }
3 ! Tests the fix for PR24207 and the problems associated
4 ! with the fix for PR21986. In two cases, use associated
5 ! public symbols were taking on the default private access
6 ! attribute of the local namespace. In the third, a private
7 ! symbol was not available to a namelist in contained
8 ! procedure in the same module.
10 ! Based on the example in PR24207.
12 module a
13 implicit none
14 real b
15 type :: mytype
16 integer :: c
17 end type mytype
18 end module a
19 module c
20 use a
21 implicit none
22 public d
23 private
24 real x
25 contains
26 subroutine d (arg_t) ! This would cause an error
27 type (mytype) :: arg_t
28 namelist /e/ b, x ! .... as would this.
29 read(5,e)
30 arg_t%c = 42
31 end subroutine d
32 end module c