This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34760] PRIVATE variable not allowed as STAT variable in ALLOCATE
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jan 2008 22:49:48 -0000
- Subject: [Bug fortran/34760] PRIVATE variable not allowed as STAT variable in ALLOCATE
- References: <bug-34760-15620@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from burnus at gcc dot gnu dot org 2008-01-13 22:49 -------
match_variable is called for "istat" in the subroutine. For the first match, it
is FL_UNKNOWN and then - without PRIVATE - it is set to FL_VARIABLE. With
public/private, it remains FL_UNKNOWN.
As for ALLOCATE sym->attr.flavor == FL_VARIABLE is check, it fails therefore as
soon as the variable has been marked as public/private.
match_variable contains:
switch (sym->attr.flavor)
{
[...]
case FL_UNKNOWN:
if (sym->attr.access == ACCESS_PUBLIC
|| sym->attr.access == ACCESS_PRIVATE)
break;
if (gfc_add_flavor (&sym->attr, FL_VARIABLE,
sym->name, NULL) == FAILURE)
return MATCH_ERROR;
break;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34760