summaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authordomob <domob@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-13 07:26:05 +0000
committerdomob <domob@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-13 07:26:05 +0000
commitae2864a836f39691290410cd0c62fb744c267c72 (patch)
treecfb530d8bd21c019453cd0cba78bea87e46daea2 /gcc/fortran/resolve.c
parent61f23920f66f047d08254b3d4f244aab468648a6 (diff)
downloadgcc-ae2864a836f39691290410cd0c62fb744c267c72.tar.gz
2010-08-13 Daniel Kraft <d@domob.eu>
* gfortran.h (array_type): New type `AS_IMPLIED_SHAPE'. * array.c (gfc_match_array_spec): Match implied-shape specification and handle AS_IMPLIED_SHAPE correctly otherwise. * decl.c (add_init_expr_to_sym): Set upper bounds for implied-shape. (variable_decl): Some checks for implied-shape declaration. * resolve.c (resolve_symbol): Assert that array-spec is no longer AS_IMPLIED_SHAPE in any case. 2010-08-13 Daniel Kraft <d@domob.eu> * gfortran.dg/implied_shape_1.f08: New test. * gfortran.dg/implied_shape_2.f90: New test. * gfortran.dg/implied_shape_3.f08: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163221 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 9933b5d0d91..0e68af629a3 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -11673,20 +11673,24 @@ resolve_symbol (gfc_symbol *sym)
}
/* Assumed size arrays and assumed shape arrays must be dummy
- arguments. */
+ arguments. Array-spec's of implied-shape should have been resolved to
+ AS_EXPLICIT already. */
- if (sym->as != NULL
- && ((sym->as->type == AS_ASSUMED_SIZE && !sym->as->cp_was_assumed)
- || sym->as->type == AS_ASSUMED_SHAPE)
- && sym->attr.dummy == 0)
+ if (sym->as)
{
- if (sym->as->type == AS_ASSUMED_SIZE)
- gfc_error ("Assumed size array at %L must be a dummy argument",
- &sym->declared_at);
- else
- gfc_error ("Assumed shape array at %L must be a dummy argument",
- &sym->declared_at);
- return;
+ gcc_assert (sym->as->type != AS_IMPLIED_SHAPE);
+ if (((sym->as->type == AS_ASSUMED_SIZE && !sym->as->cp_was_assumed)
+ || sym->as->type == AS_ASSUMED_SHAPE)
+ && sym->attr.dummy == 0)
+ {
+ if (sym->as->type == AS_ASSUMED_SIZE)
+ gfc_error ("Assumed size array at %L must be a dummy argument",
+ &sym->declared_at);
+ else
+ gfc_error ("Assumed shape array at %L must be a dummy argument",
+ &sym->declared_at);
+ return;
+ }
}
/* Make sure symbols with known intent or optional are really dummy