return 1;
if (a.allocatable || a.dimension || a.dummy || a.external || a.intrinsic
- || a.optional || a.pointer || a.save || a.target || a.volatile_
+ || a.optional || a.pointer || a.save || a.target || a.volatile_ || a.value
|| a.access != ACCESS_UNKNOWN || a.intent != INTENT_UNKNOWN)
return 1;
return FAILURE;
st = gfc_find_symtree (gfc_current_ns->sym_root, sym->name);
- if (st && st->ambiguous && !sym->attr.generic)
+ if (st && st->ambiguous
+ && sym->attr.referenced
+ && !sym->attr.generic)
{
gfc_error ("Procedure %s at %L is ambiguous",
sym->name, &sym->declared_at);
return;
}
+ if (sym->attr.value && !sym->attr.dummy)
+ {
+ gfc_error ("'%s' at %L cannot have the VALUE attribute because "
+ "it is not a dummy", sym->name, &sym->declared_at);
+ return;
+ }
+
+
/* If a derived type symbol has reached this point, without its
type being declared, we have an error. Notice that most
conditions that produce undefined derived types have already