aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/symbol.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2008-08-08 23:22:51 +0000
committerPaul Thomas <pault@gcc.gnu.org>2008-08-08 23:22:51 +0000
commit63a3341a9d1f760b1761b365f57a27523bfb548b (patch)
tree86bf411a254c10887ecbc94dc8b2b49fdd4b8a9a /gcc/fortran/symbol.c
parente73f7547c50e91654c691a620a949085645c4e51 (diff)
downloadgcc-63a3341a9d1f760b1761b365f57a27523bfb548b.zip
gcc-63a3341a9d1f760b1761b365f57a27523bfb548b.tar.gz
gcc-63a3341a9d1f760b1761b365f57a27523bfb548b.tar.bz2
re PR fortran/37011 (F2003, type extension: multiple inheritence not rejected)
2008-08-09 Paul Thomas <pault@gcc.gnu.org> PR fortran/37011 * symbol.c (gfc_add_extension): New function. * decl.c (gfc_get_type_attr_spec): Call it. (gfc_match_derived_decl): Set symbol extension attribute from attr.extension. * gfortran.h : Add prototype for gfc_add_extension. From-SVN: r138891
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r--gcc/fortran/symbol.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index bf709fa..6b64bcf 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -1468,6 +1468,27 @@ gfc_add_is_bind_c (symbol_attribute *attr, const char *name, locus *where,
}
+/* Set the extension field for the given symbol_attribute. */
+
+gfc_try
+gfc_add_extension (symbol_attribute *attr, locus *where)
+{
+ if (where == NULL)
+ where = &gfc_current_locus;
+
+ if (attr->extension)
+ gfc_error_now ("Duplicate EXTENDS attribute specified at %L", where);
+ else
+ attr->extension = 1;
+
+ if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: EXTENDS at %L", where)
+ == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
gfc_try
gfc_add_explicit_interface (gfc_symbol *sym, ifsrc source,
gfc_formal_arglist * formal, locus *where)