diff options
author | Janus Weil <janus@gcc.gnu.org> | 2009-10-07 12:54:35 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2009-10-07 12:54:35 +0200 |
commit | 93d7668704bbd18bfdc52deddb247e9412a20d85 (patch) | |
tree | 3bf167a3aed6e5f0c7dbf6adee8b94b78307052c /gcc/fortran/symbol.c | |
parent | 0b9036f4d1c5a4e3dce4e8be4e7ea3dfe7050d8d (diff) | |
download | gcc-93d7668704bbd18bfdc52deddb247e9412a20d85.zip gcc-93d7668704bbd18bfdc52deddb247e9412a20d85.tar.gz gcc-93d7668704bbd18bfdc52deddb247e9412a20d85.tar.bz2 |
expr.c (gfc_check_pointer_assign): Do the correct type checking when CLASS variables are involved.
2009-10-07 Janus Weil <janus@gcc.gnu.org>
* expr.c (gfc_check_pointer_assign): Do the correct type checking when
CLASS variables are involved.
* match.c (gfc_match_select_type): Parse associate-name in SELECT TYPE
statements, and set up a local namespace for the SELECT TYPE block.
* parse.h (gfc_build_block_ns): New prototype.
* parse.c (parse_select_type_block): Return from local namespace to its
parent after SELECT TYPE block.
(gfc_build_block_ns): New function for setting up the local namespace
for a BLOCK construct.
(parse_block_construct): Use gfc_build_block_ns.
* resolve.c (resolve_select_type): Insert assignment for the selector
variable, in case an associate-name is given, and put the SELECT TYPE
statement inside a BLOCK.
(resolve_code): Call resolve_class_assign after checking the assignment.
* symbol.c (gfc_find_sym_tree): Moved some code here from
gfc_get_ha_sym_tree.
(gfc_get_ha_sym_tree): Moved some code to gfc_find_sym_tree.
2009-10-07 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/same_type_as_2.f03: Modified (was illegal).
* gfortran.dg/select_type_1.f03: Modified error message.
* gfortran.dg/select_type_5.f03: New test.
From-SVN: r152526
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r-- | gcc/fortran/symbol.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 8cd18db..befa90b 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -2479,6 +2479,12 @@ gfc_find_sym_tree (const char *name, gfc_namespace *ns, int parent_flag, st = gfc_find_symtree (ns->sym_root, name); if (st != NULL) { + /* Special case: If we're in a SELECT TYPE block, + replace the selector variable by a temporary. */ + if (gfc_current_state () == COMP_SELECT_TYPE + && st && st->n.sym == type_selector) + st = select_type_tmp; + *result = st; /* Ambiguous generic interfaces are permitted, as long as the specific interfaces are different. */ @@ -2645,12 +2651,6 @@ gfc_get_ha_sym_tree (const char *name, gfc_symtree **result) i = gfc_find_sym_tree (name, gfc_current_ns, 0, &st); - /* Special case: If we're in a SELECT TYPE block, - replace the selector variable by a temporary. */ - if (gfc_current_state () == COMP_SELECT_TYPE - && st && st->n.sym == type_selector) - st = select_type_tmp; - if (st != NULL) { save_symbol_data (st->n.sym); |