summaryrefslogtreecommitdiffstats
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authortobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-09 21:20:50 +0000
committertobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-09 21:20:50 +0000
commitc1a3b6650d36a1defa9e50049828459716dbc661 (patch)
treed3352c7a5ccff7412b5e6acf7f1978a0e40eb5b6 /gcc/fortran/resolve.c
parent6a2ba6a93baf120718f6e6fc641ca771b5fb3f96 (diff)
downloadppe42-gcc-c1a3b6650d36a1defa9e50049828459716dbc661.tar.gz
ppe42-gcc-c1a3b6650d36a1defa9e50049828459716dbc661.zip
PR fortran/13201
* resolve.c (resolve_symbol): Verify that the shape of a parameter array is not only explicit, but also constant. * array.c (gfc_is_compile_time_shape): New function. * gfortran.h (gfc_is_compile_time_shape): Add prototype. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84400 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index a10709504f9..81df9ef03f8 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -3745,12 +3745,14 @@ resolve_symbol (gfc_symbol * sym)
return;
}
- if (sym->attr.flavor == FL_PARAMETER
- && sym->as != NULL && sym->as->type != AS_EXPLICIT)
+ /* A parameter array's shape needs to be constant. */
+
+ if (sym->attr.flavor == FL_PARAMETER && sym->as != NULL
+ && !gfc_is_compile_time_shape (sym->as))
{
- gfc_error ("Parameter array '%s' at %L must have an explicit shape",
- sym->name, &sym->declared_at);
- return;
+ gfc_error ("Parameter array '%s' at %L cannot be automatic "
+ "or assumed shape", sym->name, &sym->declared_at);
+ return;
}
/* Make sure that character string variables with assumed length are
OpenPOWER on IntegriCloud