aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/module.c
diff options
context:
space:
mode:
authorDaniel Franke <franke.daniel@gmail.com>2007-07-28 04:51:06 -0400
committerDaniel Franke <dfranke@gcc.gnu.org>2007-07-28 04:51:06 -0400
commit5cca320dca64f20a69be6cbfd0145df99a5168ac (patch)
tree104c0f20c96545cd7c2f19d9fb931ba20274aa9d /gcc/fortran/module.c
parent758137cd60130053849b6c6258acfd2f81463739 (diff)
downloadgcc-5cca320dca64f20a69be6cbfd0145df99a5168ac.zip
gcc-5cca320dca64f20a69be6cbfd0145df99a5168ac.tar.gz
gcc-5cca320dca64f20a69be6cbfd0145df99a5168ac.tar.bz2
re PR fortran/31818 (Wrongly accepts namelists with assumed-shape arrays)
gcc/fortran: 2007-07-28 Daniel Franke <franke.daniel@gmail.com> PR fortran/31818 PR fortran/32876 PR fortran/32905 * gfortran.h (symbol_attribute): Added bits for pointer_comp, private_comp. * parse.c (parse_derived): Set pointer_comp/private_comp bits if the derived type ultimately contains pointer components or private components. * module.c (ab_attribute): New values AB_POINTER_COMP, AB_PRIVATE_COMP. (attr_bits): Added names for new ab_attributes. (mio_symbol_attribute): Save/restore new attribute bits in modules. * match.c (gfc_match_namelist): Removed check for namelist objects of assumed shape. * resolve.c (resolve_fl_namelist): Added check for pointer or private components in nested types. Added check for namelist objects of assumed shape. gcc/testsuite: 2007-07-28 Daniel Franke <franke.daniel@gmail.com> * gfortran.dg/namelist_5.f90: Adjusted error message. * gfortran.dg/assumed_shape_nml.f90: Renamed to ... * gfortran.dg/namelist_31.f90: ... this. Removed dg-warning directive. * gfortran.dg/assumed_size_nml.f90: Renamed to ... * gfortran.dg/namelist_32.f90: ... this. PR fortran/32876 * gfortran.dg/namelist_33.f90: New test. PR fortran/32905 * gfortran.dg/namelist_34.f90: New test. PR fortran/31818 * gfortran.dg/namelist_35.f90: New test. From-SVN: r127014
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r--gcc/fortran/module.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 31b7c9b..447ba00 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -1512,8 +1512,8 @@ typedef enum
AB_IN_NAMELIST, AB_IN_COMMON, AB_FUNCTION, AB_SUBROUTINE, AB_SEQUENCE,
AB_ELEMENTAL, AB_PURE, AB_RECURSIVE, AB_GENERIC, AB_ALWAYS_EXPLICIT,
AB_CRAY_POINTER, AB_CRAY_POINTEE, AB_THREADPRIVATE, AB_ALLOC_COMP,
- AB_VALUE, AB_VOLATILE, AB_PROTECTED, AB_IS_BIND_C, AB_IS_C_INTEROP,
- AB_IS_ISO_C
+ AB_POINTER_COMP, AB_PRIVATE_COMP, AB_VALUE, AB_VOLATILE, AB_PROTECTED,
+ AB_IS_BIND_C, AB_IS_C_INTEROP, AB_IS_ISO_C
}
ab_attribute;
@@ -1548,6 +1548,8 @@ static const mstring attr_bits[] =
minit ("IS_ISO_C", AB_IS_ISO_C),
minit ("VALUE", AB_VALUE),
minit ("ALLOC_COMP", AB_ALLOC_COMP),
+ minit ("POINTER_COMP", AB_POINTER_COMP),
+ minit ("PRIVATE_COMP", AB_PRIVATE_COMP),
minit ("PROTECTED", AB_PROTECTED),
minit (NULL, -1)
};
@@ -1654,6 +1656,10 @@ mio_symbol_attribute (symbol_attribute *attr)
MIO_NAME(ab_attribute) (AB_IS_ISO_C, attr_bits);
if (attr->alloc_comp)
MIO_NAME (ab_attribute) (AB_ALLOC_COMP, attr_bits);
+ if (attr->pointer_comp)
+ MIO_NAME (ab_attribute) (AB_POINTER_COMP, attr_bits);
+ if (attr->private_comp)
+ MIO_NAME (ab_attribute) (AB_PRIVATE_COMP, attr_bits);
mio_rparen ();
@@ -1760,6 +1766,12 @@ mio_symbol_attribute (symbol_attribute *attr)
case AB_ALLOC_COMP:
attr->alloc_comp = 1;
break;
+ case AB_POINTER_COMP:
+ attr->pointer_comp = 1;
+ break;
+ case AB_PRIVATE_COMP:
+ attr->private_comp = 1;
+ break;
}
}
}