aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/module.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2006-12-10 20:53:07 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2006-12-10 20:53:07 +0100
commitee7e677fdd929eb1b9fd60efa476c86fd0692784 (patch)
treefd873c228f212288e3d63dae896648e0ca50835b /gcc/fortran/module.c
parent42c1cd8a7ac43e4d324fbd4f6051ec56f83cd00b (diff)
downloadgcc-ee7e677fdd929eb1b9fd60efa476c86fd0692784.zip
gcc-ee7e677fdd929eb1b9fd60efa476c86fd0692784.tar.gz
gcc-ee7e677fdd929eb1b9fd60efa476c86fd0692784.tar.bz2
re PR fortran/23994 (PROTECTED attribute (F2003) is not implemented)
fortran/ 2006-12-10 Tobias Burnus <burnus@net-b.de> PR fortran/23994 * interface.c (compare_actual_formal): PROTECTED is incompatible with intent(out). * symbol.c (check_conflict): Check for PROTECTED conflicts. (gfc_add_protected): New function. (gfc_copy_attr): Copy PROTECTED attribute. * decl.c (match_attr_spec): Add PROTECTED support. (gfc_match_protected): New function. * dump-parse-tree.c (gfc_show_attr): Add PROTECTED support. * gfortran.h (gfc_symbol): Add protected flag. Add gfc_add_protected prototype. * expr.c (gfc_check_pointer_assign): Add PROTECTED support. * module.c (ab_attribute, attr_bits, mio_symbol_attribute, mio_symbol_attribute): Add PROTECTED support. * resolve.c (resolve_equivalence): Add PROTECTED support. * match.c (gfc_match_assignment,)gfc_match_pointer_assignment: Check PROTECTED attribute. * match.h: Add gfc_match_protected prototype. * parse.c (decode_statement): Match PROTECTED statement. * primary.c (match_variable): Add PROTECTED support. testsuite/ 2006-12-10 Tobias Burnus <burnus@net-b.de> PR fortran/23994 * gfortran.dg/protected_1.f90: New test. * gfortran.dg/protected_2.f90: New test. * gfortran.dg/protected_3.f90: New test. * gfortran.dg/protected_4.f90: New test. * gfortran.dg/protected_5.f90: New test. * gfortran.dg/protected_6.f90: New test. From-SVN: r119709
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r--gcc/fortran/module.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index ca4e091..f54ef8e 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -1491,7 +1491,7 @@ 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_VALUE, AB_VOLATILE, AB_PROTECTED
}
ab_attribute;
@@ -1524,6 +1524,7 @@ static const mstring attr_bits[] =
minit ("CRAY_POINTER", AB_CRAY_POINTER),
minit ("CRAY_POINTEE", AB_CRAY_POINTEE),
minit ("ALLOC_COMP", AB_ALLOC_COMP),
+ minit ("PROTECTED", AB_PROTECTED),
minit (NULL, -1)
};
@@ -1574,6 +1575,8 @@ mio_symbol_attribute (symbol_attribute * attr)
MIO_NAME(ab_attribute) (AB_OPTIONAL, attr_bits);
if (attr->pointer)
MIO_NAME(ab_attribute) (AB_POINTER, attr_bits);
+ if (attr->protected)
+ MIO_NAME(ab_attribute) (AB_PROTECTED, attr_bits);
if (attr->save)
MIO_NAME(ab_attribute) (AB_SAVE, attr_bits);
if (attr->value)
@@ -1655,6 +1658,9 @@ mio_symbol_attribute (symbol_attribute * attr)
case AB_POINTER:
attr->pointer = 1;
break;
+ case AB_PROTECTED:
+ attr->protected = 1;
+ break;
case AB_SAVE:
attr->save = 1;
break;