Commit b7263e8f by Erik Edelmann Committed by Steven G. Kargl

re PR fortran/19926 ([4.0 only] Incorrect rank with PARAMETER and array element.)

PR fortran/19926
* primary.c (gfc_match_rvalue):  expr_type can be EXPR_CONSTANT
  for an array; check that sym->as is NULL.

Co-Authored-By: Steven G. Kargl <kargls@comast.net>

From-SVN: r101161
parent 14ceeb32
2005-06-18 Erik Edelman <eedelman@acclab.helsinki.fi>
Steven G. Kargl <kargls@comast.net>
PR fortran/19926
* primary.c (gfc_match_rvalue): expr_type can be EXPR_CONSTANT
for an array; check that sym->as is NULL.
2005-06-18 Steven G. Kargl <kargls@comcast.net> 2005-06-18 Steven G. Kargl <kargls@comcast.net>
* intrinsic.c (gfc_intrinsic_func_interface): Enable errors for generic * intrinsic.c (gfc_intrinsic_func_interface): Enable errors for generic
......
...@@ -1802,8 +1802,11 @@ gfc_match_rvalue (gfc_expr ** result) ...@@ -1802,8 +1802,11 @@ gfc_match_rvalue (gfc_expr ** result)
break; break;
case FL_PARAMETER: case FL_PARAMETER:
if (sym->value /* A statement of the form "REAL, parameter :: a(0:10) = 1" will
&& sym->value->expr_type != EXPR_ARRAY) end up here. Unfortunately, sym->value->expr_type is set to
EXPR_CONSTANT, and so the if () branch would be followed without
the !sym->as check. */
if (sym->value && sym->value->expr_type != EXPR_ARRAY && !sym->as)
e = gfc_copy_expr (sym->value); e = gfc_copy_expr (sym->value);
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment