diff options
author | Janus Weil <janus@gcc.gnu.org> | 2010-06-16 14:54:54 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2010-06-16 14:54:54 +0200 |
commit | 3e15518bc4c70b541b667e9f6bf3dfb80053b5ae (patch) | |
tree | e59b7cfa05176efde69a8f830c9e84a169966a62 /gcc/fortran/decl.c | |
parent | fe27aa8bc46f9ce5324d19e1102901639274c578 (diff) | |
download | gcc-3e15518bc4c70b541b667e9f6bf3dfb80053b5ae.zip gcc-3e15518bc4c70b541b667e9f6bf3dfb80053b5ae.tar.gz gcc-3e15518bc4c70b541b667e9f6bf3dfb80053b5ae.tar.bz2 |
re PR fortran/44549 ([OOP][F2008] Type-bound procedure: bogus error from list after PROCEDURE)
2010-06-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/44549
* gfortran.h (gfc_get_typebound_proc): Modified Prototype.
* decl.c (match_procedure_in_type): Give a unique gfc_typebound_proc
structure to each procedure in a procedure list.
* module.c (mio_typebound_proc): Add NULL argument to
'gfc_get_typebound_proc'.
* symbol.c (gfc_get_typebound_proc): Add a new argument, which is used
to initialize the new structure.
2010-06-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/44549
* gfortran.dg/typebound_proc_16.f03: New.
From-SVN: r160834
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index f969383..c9b46a2 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -7543,7 +7543,7 @@ match_procedure_in_type (void) char name[GFC_MAX_SYMBOL_LEN + 1]; char target_buf[GFC_MAX_SYMBOL_LEN + 1]; char* target = NULL, *ifc = NULL; - gfc_typebound_proc* tb; + gfc_typebound_proc tb; bool seen_colons; bool seen_attrs; match m; @@ -7579,23 +7579,22 @@ match_procedure_in_type (void) } /* Construct the data structure. */ - tb = gfc_get_typebound_proc (); - tb->where = gfc_current_locus; - tb->is_generic = 0; + tb.where = gfc_current_locus; + tb.is_generic = 0; /* Match binding attributes. */ - m = match_binding_attributes (tb, false, false); + m = match_binding_attributes (&tb, false, false); if (m == MATCH_ERROR) return m; seen_attrs = (m == MATCH_YES); /* Check that attribute DEFERRED is given if an interface is specified. */ - if (tb->deferred && !ifc) + if (tb.deferred && !ifc) { gfc_error ("Interface must be specified for DEFERRED binding at %C"); return MATCH_ERROR; } - if (ifc && !tb->deferred) + if (ifc && !tb.deferred) { gfc_error ("PROCEDURE(interface) at %C should be declared DEFERRED"); return MATCH_ERROR; @@ -7635,7 +7634,7 @@ match_procedure_in_type (void) return m; if (m == MATCH_YES) { - if (tb->deferred) + if (tb.deferred) { gfc_error ("'=> target' is invalid for DEFERRED binding at %C"); return MATCH_ERROR; @@ -7668,7 +7667,7 @@ match_procedure_in_type (void) gcc_assert (ns); /* If the binding is DEFERRED, check that the containing type is ABSTRACT. */ - if (tb->deferred && !block->attr.abstract) + if (tb.deferred && !block->attr.abstract) { gfc_error ("Type '%s' containing DEFERRED binding at %C " "is not ABSTRACT", block->name); @@ -7693,11 +7692,12 @@ match_procedure_in_type (void) stree = gfc_new_symtree (&ns->tb_sym_root, name); gcc_assert (stree); } - stree->n.tb = tb; + stree->n.tb = gfc_get_typebound_proc (&tb); - if (gfc_get_sym_tree (target, gfc_current_ns, &tb->u.specific, false)) + if (gfc_get_sym_tree (target, gfc_current_ns, &stree->n.tb->u.specific, + false)) return MATCH_ERROR; - gfc_set_sym_referenced (tb->u.specific->n.sym); + gfc_set_sym_referenced (stree->n.tb->u.specific->n.sym); if (gfc_match_eos () == MATCH_YES) return MATCH_YES; @@ -7841,7 +7841,7 @@ gfc_match_generic (void) } else { - tb = gfc_get_typebound_proc (); + tb = gfc_get_typebound_proc (NULL); tb->where = gfc_current_locus; tb->access = tbattr.access; tb->is_generic = 1; |