aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
authorSteven G. Kargl <kargl@gcc.gnu.org>2010-11-02 17:09:58 +0000
committerTobias Burnus <burnus@gcc.gnu.org>2010-11-02 18:09:58 +0100
commite69afb29dc3f151d0768be9ce610da4348b0d62b (patch)
treea9c5829a131f0881ac6b0d89cb235321f6bb720c /gcc/fortran/expr.c
parent343b2efcd766d7d56016c0ae85b6eb13d9597b9e (diff)
downloadgcc-e69afb29dc3f151d0768be9ce610da4348b0d62b.zip
gcc-e69afb29dc3f151d0768be9ce610da4348b0d62b.tar.gz
gcc-e69afb29dc3f151d0768be9ce610da4348b0d62b.tar.bz2
2010-11-02 Steven G.
2010-11-02 Steven G. Kargl < kargl@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/45170 * array.c (gfc_match_array_constructor): Reject deferred type parameter (DTP) in type-spec. * decl.c (char_len_param_value, match_char_length, gfc_match_char_spec, build_sym, variable_decl, enumerator_decl): Support DTP. * expr.c (check_inquiry): Fix check due to support for DTP. * gfortran.h (gfc_typespec): Add Boolean 'deferred'. * misc.c (gfc_clear_ts): Set it to false. * match.c (gfc_match_allocate): Support DTP. * resolve.c (resolve_allocate_expr): Not-implemented error for * DTP. (resolve_fl_variable): Add DTP constraint check. * trans-decl.c (gfc_trans_deferred_vars): Add not-implemented error for DTP. 2010-11-02 Steven G. Kargl < kargl@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/45170 * gfortran.dg/deferred_type_param_1.f90: New. * gfortran.dg/deferred_type_param_2.f90: New. * gfortran.dg/initialization_1.f90: Update dg-errors. * gfortran.dg/initialization_9.f90: Update dg-errors. Co-Authored-By: Tobias Burnus <burnus@net-b.de> From-SVN: r166205
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index e567c98..8dfbf73 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -2292,10 +2292,13 @@ check_inquiry (gfc_expr *e, int not_restricted)
with LEN, as required by the standard. */
if (i == 5 && not_restricted
&& ap->expr->symtree->n.sym->ts.type == BT_CHARACTER
- && ap->expr->symtree->n.sym->ts.u.cl->length == NULL)
+ && (ap->expr->symtree->n.sym->ts.u.cl->length == NULL
+ || ap->expr->symtree->n.sym->ts.deferred))
{
- gfc_error ("Assumed character length variable '%s' in constant "
- "expression at %L", e->symtree->n.sym->name, &e->where);
+ gfc_error ("Assumed or deferred character length variable '%s' "
+ " in constant expression at %L",
+ ap->expr->symtree->n.sym->name,
+ &ap->expr->where);
return MATCH_ERROR;
}
else if (not_restricted && check_init_expr (ap->expr) == FAILURE)