From a3d3c0f5fa9cd88e6285f60c593cb753cc53d4c2 Mon Sep 17 00:00:00 2001 From: Daniel Kraft Date: Thu, 9 Oct 2008 09:28:22 +0200 Subject: re PR fortran/35723 (Can't use run-time array element in character declaration) 2008-10-09 Daniel Kraft 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 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 --- gcc/fortran/array.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gcc/fortran/array.c') 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); -- cgit v1.1