PR fortran/24207
* resolve.c (resolve_symbol): Exclude use and host associated
symbols from the test for private objects in a public namelist.
2005-10-12 Paul Thomas <pault@gcc.gnu.org>
PR fortran/24207
gfortran.dg/private_type_3.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105289
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-10-12 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/24207
+ * resolve.c (resolve_symbol): Exclude use and host associated
+ symbols from the test for private objects in a public namelist.
+
2005-10-12 Jakub Jelinek <jakub@redhat.com>
* trans-common.c (build_field): Fix comment typo.
{
if (arg->sym
&& arg->sym->ts.type == BT_DERIVED
+ && !arg->sym->ts.derived->attr.use_assoc
&& !gfc_check_access(arg->sym->ts.derived->attr.access,
arg->sym->ts.derived->ns->default_access))
{
{
for (nl = sym->namelist; nl; nl = nl->next)
{
- if (!gfc_check_access(nl->sym->attr.access,
+ if (!nl->sym->attr.use_assoc
+ &&
+ !(sym->ns->parent == nl->sym->ns)
+ &&
+ !gfc_check_access(nl->sym->attr.access,
nl->sym->ns->default_access))
gfc_error ("PRIVATE symbol '%s' cannot be member of "
"PUBLIC namelist at %L", nl->sym->name,
+2005-10-12 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/24207
+ gfortran.dg/private_type_3.f90: New test.
+
2005-10-11 Steven G. Kargl <kargls@comcast.net>
PR fortran/20786
--- /dev/null
+! { dg-do compile }
+! { dg-options "-O0" }
+! Tests the fix for PR24207 and the problems associated
+! with the fix for PR21986. In two cases, use associated
+! public symbols were taking on the default private access
+! attribute of the local namespace. In the third, a private
+! symbol was not available to a namelist in contained
+! procedure in the same module.
+!
+! Based on the example in PR24207.
+!
+module a
+ implicit none
+ real b
+ type :: mytype
+ integer :: c
+ end type mytype
+end module a
+module c
+ use a
+ implicit none
+ public d
+ private
+ real x
+ contains
+ subroutine d (arg_t) ! This would cause an error
+ type (mytype) :: arg_t
+ namelist /e/ b, x ! .... as would this.
+ read(5,e)
+ arg_t%c = 42
+ end subroutine d
+end module c
+