diff options
author | Daniel Kraft <d@domob.eu> | 2008-08-25 19:58:53 +0200 |
---|---|---|
committer | Daniel Kraft <domob@gcc.gnu.org> | 2008-08-25 19:58:53 +0200 |
commit | 9d1210f47f50fa5a1e397632792aa97668e56e0e (patch) | |
tree | 48f2f28391f6447501ac0481370dfd5b4e376e7c /gcc/fortran/parse.c | |
parent | e02aa5ec860b71931d3223505e0337ffb5d1a7a4 (diff) | |
download | gcc-9d1210f47f50fa5a1e397632792aa97668e56e0e.zip gcc-9d1210f47f50fa5a1e397632792aa97668e56e0e.tar.gz gcc-9d1210f47f50fa5a1e397632792aa97668e56e0e.tar.bz2 |
gfortran.h (gfc_find_component): Add new arguments.
2008-08-25 Daniel Kraft <d@domob.eu>
* gfortran.h (gfc_find_component): Add new arguments.
* parse.c (parse_derived_contains): Check if the derived-type containing
the CONTAINS section is SEQUENCE/BIND(C).
* resolve.c (resolve_typebound_procedure): Check for name collision with
components.
(resolve_fl_derived): Check for name collision with inherited
type-bound procedures.
* symbol.c (gfc_find_component): New arguments `noaccess' and `silent'.
(gfc_add_component): Adapt for new arguments.
* primary.c (match_varspec), (gfc_match_structure_constructor): Ditto.
2008-08-25 Daniel Kraft <d@domob.eu>
* gfortran.dg/extends_7.f03: New test.
* gfortran.dg/typebound_proc_7.f03: New test.
* gfortran.dg/typebound_proc_8.f03: New test.
From-SVN: r139566
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r-- | gcc/fortran/parse.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index 4bf1b81..f12afd5 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -1715,8 +1715,19 @@ parse_derived_contains (void) bool error_flag = false; bool to_finish; - accept_statement (ST_CONTAINS); gcc_assert (gfc_current_state () == COMP_DERIVED); + gcc_assert (gfc_current_block ()); + + /* Derived-types with SEQUENCE and/or BIND(C) must not have a CONTAINS + section. */ + if (gfc_current_block ()->attr.sequence) + gfc_error ("Derived-type '%s' with SEQUENCE must not have a CONTAINS" + " section at %C", gfc_current_block ()->name); + if (gfc_current_block ()->attr.is_bind_c) + gfc_error ("Derived-type '%s' with BIND(C) must not have a CONTAINS" + " section at %C", gfc_current_block ()->name); + + accept_statement (ST_CONTAINS); push_state (&s, COMP_DERIVED_CONTAINS, NULL); to_finish = false; |