aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.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/decl.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/decl.c')
-rw-r--r--gcc/fortran/decl.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 2b4bda1..1249780 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -6340,8 +6340,7 @@ gfc_get_type_attr_spec (symbol_attribute *attr, char *name)
}
else if (name && gfc_match(" , extends ( %n )", name) == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: derived type "
- "extended at %C") == FAILURE)
+ if (gfc_add_extension (attr, &gfc_current_locus) == FAILURE)
return MATCH_ERROR;
}
else
@@ -6385,7 +6384,9 @@ gfc_match_derived_decl (void)
seen_attr = true;
} while (is_type_attr_spec == MATCH_YES);
- /* Deal with derived type extensions. */
+ /* Deal with derived type extensions. The extension attribute has
+ been added to 'attr' but now the parent type must be found and
+ checked. */
if (parent[0])
extended = check_extended_derived_type (parent);
@@ -6457,7 +6458,7 @@ gfc_match_derived_decl (void)
/* Add the extended derived type as the first component. */
gfc_add_component (sym, parent, &p);
- sym->attr.extension = 1;
+ sym->attr.extension = attr.extension;
extended->refs++;
gfc_set_sym_referenced (extended);