aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/array.c
diff options
context:
space:
mode:
authorDaniel Kraft <d@domob.eu>2008-10-09 09:28:22 +0200
committerDaniel Kraft <domob@gcc.gnu.org>2008-10-09 09:28:22 +0200
commita3d3c0f5fa9cd88e6285f60c593cb753cc53d4c2 (patch)
treed9580ac4df12f19afd82891b682e7616c40bfac2 /gcc/fortran/array.c
parentcdb148c194bac4a574cb77ee2522e418b9681860 (diff)
downloadgcc-a3d3c0f5fa9cd88e6285f60c593cb753cc53d4c2.zip
gcc-a3d3c0f5fa9cd88e6285f60c593cb753cc53d4c2.tar.gz
gcc-a3d3c0f5fa9cd88e6285f60c593cb753cc53d4c2.tar.bz2
re PR fortran/35723 (Can't use run-time array element in character declaration)
2008-10-09 Daniel Kraft <d@domob.eu> PR fortran/35723 * gfortran.h (gfc_suppress_error): Removed from header. (gfc_push_suppress_errors), (gfc_pop_suppress_errors): New methods. * array.c (gfc_array_size): Use new gfc_push/pop_suppress_errors instead of directly changing gfc_suppress_error. * intrinsic.c (gfc_intrinsic_func_interface): Ditto. (gfc_intrinsic_sub_interface): Ditto. * error.c (suppress_errors): Made static from `gfc_suppress_error'. (gfc_push_suppress_errors), (gfc_pop_suppress_errors): New methods. (gfc_notify_std), (gfc_error): Use new static name of global. * expr.c (check_arglist), (check_references): New methods. (check_restricted): Check arglists and references of EXPR_FUNCTIONs and EXPR_VARAIBALEs, respectively. Allow PARAMETER symbols. 2008-10-09 Daniel Kraft <d@domob.eu> PR fortran/35723 * gfortran.dg/restricted_expression_1.f90: New test. * gfortran.dg/restricted_expression_2.f90: New test. * gfortran.dg/restricted_expression_3.f90: New test. From-SVN: r141001
Diffstat (limited to 'gcc/fortran/array.c')
-rw-r--r--gcc/fortran/array.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c
index d99ed9e..70cf662 100644
--- a/gcc/fortran/array.c
+++ b/gcc/fortran/array.c
@@ -2073,14 +2073,13 @@ gfc_array_size (gfc_expr *array, mpz_t *result)
{
expand_info expand_save;
gfc_ref *ref;
- int i, flag;
+ int i;
gfc_try t;
switch (array->expr_type)
{
case EXPR_ARRAY:
- flag = gfc_suppress_error;
- gfc_suppress_error = 1;
+ gfc_push_suppress_errors ();
expand_save = current_expand;
@@ -2091,7 +2090,8 @@ gfc_array_size (gfc_expr *array, mpz_t *result)
iter_stack = NULL;
t = expand_constructor (array->value.constructor);
- gfc_suppress_error = flag;
+
+ gfc_pop_suppress_errors ();
if (t == FAILURE)
mpz_clear (*result);