aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/match.c
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2011-05-21 21:12:51 +0200
committerJanus Weil <janus@gcc.gnu.org>2011-05-21 21:12:51 +0200
commit43a9eec7c4ce367bd971617831372cc53bbeb85a (patch)
tree66a8f7f13d2a20bca57942c8ae10efacf9913fc5 /gcc/fortran/match.c
parenta5dfec9a97f275141625257dbf1e36e9035b9ea7 (diff)
downloadgcc-43a9eec7c4ce367bd971617831372cc53bbeb85a.zip
gcc-43a9eec7c4ce367bd971617831372cc53bbeb85a.tar.gz
gcc-43a9eec7c4ce367bd971617831372cc53bbeb85a.tar.bz2
re PR fortran/48699 ([OOP] MOVE_ALLOC inside SELECT TYPE)
2011-05-21 Janus Weil <janus@gcc.gnu.org> PR fortran/48699 * match.c (select_type_set_tmp): Make the temporary ALLOCATABLE if the selector is ALLOCATABLE. 2011-05-21 Janus Weil <janus@gcc.gnu.org> PR fortran/48699 * gfortran.dg/select_type_23.f03: New. From-SVN: r174001
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r--gcc/fortran/match.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index f1c953a..75f2a7f 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -4533,7 +4533,11 @@ select_type_set_tmp (gfc_typespec *ts)
gfc_get_sym_tree (name, gfc_current_ns, &tmp, false);
gfc_add_type (tmp->n.sym, ts, NULL);
gfc_set_sym_referenced (tmp->n.sym);
- gfc_add_pointer (&tmp->n.sym->attr, NULL);
+ if (select_type_stack->selector->ts.type == BT_CLASS &&
+ CLASS_DATA (select_type_stack->selector)->attr.allocatable)
+ gfc_add_allocatable (&tmp->n.sym->attr, NULL);
+ else
+ gfc_add_pointer (&tmp->n.sym->attr, NULL);
gfc_add_flavor (&tmp->n.sym->attr, FL_VARIABLE, name, NULL);
if (ts->type == BT_CLASS)
gfc_build_class_symbol (&tmp->n.sym->ts, &tmp->n.sym->attr,