aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/match.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r--gcc/fortran/match.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 8ae34a9..82d2b50 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -2265,7 +2265,10 @@ found:
a scalar integer initialization-expr and valid kind parameter. */
if (c == ')')
{
- if (e->ts.type != BT_INTEGER || e->rank > 0)
+ bool ok = true;
+ if (e->expr_type != EXPR_CONSTANT && e->expr_type != EXPR_VARIABLE)
+ ok = gfc_reduce_init_expr (e);
+ if (!ok || e->ts.type != BT_INTEGER || e->rank > 0)
{
gfc_free_expr (e);
return MATCH_NO;