aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/class.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2011-12-03 19:30:36 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2011-12-03 19:30:36 +0100
commit7d40e49f27458de1c3b0481b3cf94e03b73fdd7f (patch)
treefd93a90a523df23aa531f68dea337f8c7dd73fd7 /gcc/fortran/class.c
parent99b375d0b9802b28f3250ef3d2af6ac56d6d4c7c (diff)
downloadgcc-7d40e49f27458de1c3b0481b3cf94e03b73fdd7f.zip
gcc-7d40e49f27458de1c3b0481b3cf94e03b73fdd7f.tar.gz
gcc-7d40e49f27458de1c3b0481b3cf94e03b73fdd7f.tar.bz2
re PR fortran/48887 ([OOP] SELECT TYPE: Associate name shall not be a pointer/allocatable)
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/48887 * gfortran.dg/select_type_24.f90: New. * gfortran.dg/select_type_23.f03: Add dg-error. * gfortran.dg/class_45a.f03: Add missing TARGET attribute. From-SVN: r181975
Diffstat (limited to 'gcc/fortran/class.c')
-rw-r--r--gcc/fortran/class.c6
1 files changed, 4 insertions, 2 deletions
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;