diff options
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index b24399d..9bd5c00 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -374,21 +374,26 @@ resolve_formal_arglist (gfc_symbol *proc) if (gfc_elemental (proc)) { /* F08:C1289. */ - if (sym->attr.codimension) + if (sym->attr.codimension + || (sym->ts.type == BT_CLASS && CLASS_DATA (sym) + && CLASS_DATA (sym)->attr.codimension)) { gfc_error ("Coarray dummy argument '%s' at %L to elemental " "procedure", sym->name, &sym->declared_at); continue; } - if (sym->as != NULL) + if (sym->as || (sym->ts.type == BT_CLASS && CLASS_DATA (sym) + && CLASS_DATA (sym)->as)) { gfc_error ("Argument '%s' of elemental procedure at %L must " "be scalar", sym->name, &sym->declared_at); continue; } - if (sym->attr.allocatable) + if (sym->attr.allocatable + || (sym->ts.type == BT_CLASS && CLASS_DATA (sym) + && CLASS_DATA (sym)->attr.allocatable)) { gfc_error ("Argument '%s' of elemental procedure at %L cannot " "have the ALLOCATABLE attribute", sym->name, @@ -1575,6 +1580,16 @@ resolve_procedure_expression (gfc_expr* expr) } +gfc_array_spec * +symbol_as (gfc_symbol *sym) +{ + if (sym->ts.type == BT_CLASS && sym->attr.class_ok) + return CLASS_DATA (sym)->as; + else + return sym->as; +} + + /* Resolve an actual argument list. Most of the time, this is just resolving the expressions in the list. The exception is that we sometimes have to decide whether arguments |