aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 0e68af6..d274c6a 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -278,6 +278,14 @@ resolve_formal_arglist (gfc_symbol *proc)
continue;
}
+ if (sym->attr.allocatable)
+ {
+ gfc_error ("Argument '%s' of elemental procedure at %L cannot "
+ "have the ALLOCATABLE attribute", sym->name,
+ &sym->declared_at);
+ continue;
+ }
+
if (sym->attr.pointer)
{
gfc_error ("Argument '%s' of elemental procedure at %L cannot "
@@ -293,6 +301,14 @@ resolve_formal_arglist (gfc_symbol *proc)
&sym->declared_at);
continue;
}
+
+ if (sym->attr.intent == INTENT_UNKNOWN)
+ {
+ gfc_error ("Argument '%s' of elemental procedure '%s' at %L must "
+ "have its INTENT specified", sym->name, proc->name,
+ &sym->declared_at);
+ continue;
+ }
}
/* Each dummy shall be specified to be scalar. */
@@ -12474,7 +12490,7 @@ gfc_pure (gfc_symbol *sym)
if (sym == NULL)
return 0;
attr = sym->attr;
- if (attr.flavor == FL_PROCEDURE && (attr.pure || attr.elemental))
+ if (attr.flavor == FL_PROCEDURE && attr.pure)
return 1;
}
return 0;
@@ -12482,7 +12498,7 @@ gfc_pure (gfc_symbol *sym)
attr = sym->attr;
- return attr.flavor == FL_PROCEDURE && (attr.pure || attr.elemental);
+ return attr.flavor == FL_PROCEDURE && attr.pure;
}