diff options
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/fortran/class.c | 6 | ||||
-rw-r--r-- | gcc/fortran/match.c | 7 |
3 files changed, 13 insertions, 8 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index bec5430..fbe15b0 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2011-12-03 Tobias Burnus <burnus@net-b.de> + + PR fortran/48887 + * match.c (select_type_set_tmp): Don't set allocatable/pointer + attribute. + * class.c (gfc_build_class_symbol): Handle + attr.select_type_temporary. + 2011-12-03 Tobias Burnus <burnus@net-b.de> PR fortran/50684 diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c index bcb2d0b..d3f7bf3 100644 --- a/gcc/fortran/class.c +++ b/gcc/fortran/class.c @@ -188,7 +188,8 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr, /* Class container has already been built. */ return SUCCESS; - attr->class_ok = attr->dummy || attr->pointer || attr->allocatable; + attr->class_ok = attr->dummy || attr->pointer || attr->allocatable + || attr->select_type_temporary; if (!attr->class_ok) /* We can not build the class container yet. */ @@ -239,7 +240,8 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr, c->attr.access = ACCESS_PRIVATE; c->ts.u.derived = ts->u.derived; c->attr.class_pointer = attr->pointer; - c->attr.pointer = attr->pointer || attr->dummy; + c->attr.pointer = attr->pointer || (attr->dummy && !attr->allocatable) + || attr->select_type_temporary; c->attr.allocatable = attr->allocatable; c->attr.dimension = attr->dimension; c->attr.codimension = attr->codimension; diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index fbafe82..3de9c72 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -5152,16 +5152,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); - 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); + tmp->n.sym->attr.select_type_temporary = 1; if (ts->type == BT_CLASS) gfc_build_class_symbol (&tmp->n.sym->ts, &tmp->n.sym->attr, &tmp->n.sym->as, false); - tmp->n.sym->attr.select_type_temporary = 1; /* Add an association for it, so the rest of the parser knows it is an associate-name. The target will be set during resolution. */ |