aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
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);