[Bug fortran/63727] [F03] Checks missing for proc-pointer components: Usage as actual argument when elemental
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Dec 14 09:31:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63727
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2014-12-14
CC| |janus at gcc dot gnu.org
Assignee|unassigned at gcc dot gnu.org |janus at gcc dot gnu.org
Summary|Checks missing for |[F03] Checks missing for
|proc-pointer components: |proc-pointer components:
|Usage as actual argument |Usage as actual argument
|when elemental |when elemental
Ever confirmed|0 |1
--- Comment #1 from janus at gcc dot gnu.org ---
The following is sufficient to reject the code (not regtested yet):
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (Revision 218705)
+++ gcc/fortran/resolve.c (Arbeitskopie)
@@ -1740,6 +1740,7 @@ resolve_actual_arglist (gfc_actual_arglist *arg, p
gfc_symbol *sym;
gfc_symtree *parent_st;
gfc_expr *e;
+ gfc_component *comp;
int save_need_full_assumed_size;
bool return_value = false;
bool actual_arg_sav = actual_arg, first_actual_arg_sav = first_actual_arg;
@@ -1967,6 +1968,14 @@ resolve_actual_arglist (gfc_actual_arglist *arg, p
}
}
+ comp = gfc_get_proc_ptr_comp(e);
+ if (comp && comp->attr.elemental)
+ {
+ gfc_error ("ELEMENTAL procedure pointer component %qs is not "
+ "allowed as an actual argument at %L", comp->name,
+ &e->where);
+ }
+
/* Fortran 2008, C1237. */
if (e->expr_type == EXPR_VARIABLE && gfc_is_coindexed (e)
&& gfc_has_ultimate_pointer (e))
More information about the Gcc-bugs
mailing list