diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2010-11-02 17:09:58 +0000 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2010-11-02 18:09:58 +0100 |
commit | e69afb29dc3f151d0768be9ce610da4348b0d62b (patch) | |
tree | a9c5829a131f0881ac6b0d89cb235321f6bb720c /gcc/fortran/resolve.c | |
parent | 343b2efcd766d7d56016c0ae85b6eb13d9597b9e (diff) | |
download | gcc-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/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 4280555..6e71e13 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -6856,6 +6856,12 @@ check_symbols: } success: + if (e->ts.deferred) + { + gfc_error ("Support for entity at %L with deferred type parameter " + "not yet implemented", &e->where); + return FAILURE; + } return SUCCESS; failure: @@ -9371,6 +9377,7 @@ resolve_index_expr (gfc_expr *e) return SUCCESS; } + /* Resolve a charlen structure. */ static gfc_try @@ -9684,6 +9691,7 @@ apply_default_init_local (gfc_symbol *sym) build_init_assign (sym, init); } + /* Resolution of common features of flavors variable and procedure. */ static gfc_try @@ -9847,12 +9855,22 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag) return FAILURE; } + /* Constraints on deferred type parameter. */ + if (sym->ts.deferred && !(sym->attr.pointer || sym->attr.allocatable)) + { + gfc_error ("Entity '%s' at %L has a deferred type parameter and " + "requires either the pointer or allocatable attribute", + sym->name, &sym->declared_at); + return FAILURE; + } + if (sym->ts.type == BT_CHARACTER) { /* Make sure that character string variables with assumed length are dummy arguments. */ e = sym->ts.u.cl->length; - if (e == NULL && !sym->attr.dummy && !sym->attr.result) + if (e == NULL && !sym->attr.dummy && !sym->attr.result + && !sym->ts.deferred) { gfc_error ("Entity with assumed character length at %L must be a " "dummy argument or a PARAMETER", &sym->declared_at); |