This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: PR 24207 may interest you
- From: Paul THOMAS <paulthomas2 at wanadoo dot fr>
- To: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- Cc: fortran at gcc dot gnu dot org
- Date: Thu, 6 Oct 2005 10:20:17 +0200 (CEST)
- Subject: Re: PR 24207 may interest you
- Reply-to: paulthomas2 at wanadoo dot fr
Steve,
The condition needs to exclude use AND host association.
The patch below puts your case right without breaking anything.
I am unable to contemplate the formal arguments of a public procedure
at the moment - I am sitting with a PC on my lap in a conference.
However, I do not think that the condition there needs extending.
Best regards
Paul T
*** gcc/gcc/fortran/resolve.c.wrong Wed Oct 5 10:43:32 2005
--- gcc/gcc/fortran/resolve.c Thu Oct 6 09:29:36 2005
*************** resolve_symbol (gfc_symbol * sym)
*** 4330,4335 ****
--- 4330,4336 ----
{
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))
{
*************** resolve_symbol (gfc_symbol * sym)
*** 4432,4438 ****
{
for (nl = sym->namelist; nl; nl = nl->next)
{
! if (!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,
--- 4433,4443 ----
{
for (nl = sym->namelist; nl; nl = nl->next)
{
! 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,