This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/40996] [F03] ALLOCATABLE scalars
- From: "janus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Aug 2009 11:22:58 -0000
- Subject: [Bug fortran/40996] [F03] ALLOCATABLE scalars
- References: <bug-40996-16146@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from janus at gcc dot gnu dot org 2009-08-07 11:22 -------
The following is enough to make the test case work:
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 150529)
+++ gcc/fortran/resolve.c (working copy)
@@ -5591,7 +5591,7 @@
code->next = init_st;
}
- if (pointer && dimension == 0)
+ if (pointer || dimension == 0)
return SUCCESS;
/* Make sure the next-to-last reference node is an array specification. */
@@ -7883,15 +7883,11 @@
/* Constraints on deferred shape variable. */
if (sym->as == NULL || sym->as->type != AS_DEFERRED)
{
- if (sym->attr.allocatable)
+ if (sym->attr.allocatable && sym->attr.dimension)
{
- if (sym->attr.dimension)
- gfc_error ("Allocatable array '%s' at %L must have "
- "a deferred shape", sym->name, &sym->declared_at);
- else
- gfc_error ("Scalar object '%s' at %L may not be ALLOCATABLE",
- sym->name, &sym->declared_at);
- return FAILURE;
+ gfc_error ("Allocatable array '%s' at %L must have a deferred shape",
+ sym->name, &sym->declared_at);
+ return FAILURE;
}
if (sym->attr.pointer && sym->attr.dimension)
--
janus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |janus at gcc dot gnu dot org
|dot org |
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-08-07 11:22:57
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40996