From: Janus Weil Date: Mon, 15 Dec 2014 16:10:50 +0000 (+0100) Subject: re PR fortran/63727 ([F03] Checks missing for proc-pointer components: Usage as actua... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d06790a0b2e733c39033a32d00fa522ecb0308b1;p=gcc.git re PR fortran/63727 ([F03] Checks missing for proc-pointer components: Usage as actual argument when elemental) 2014-12-15 Janus Weil PR fortran/63727 * resolve.c (resolve_actual_arglist): Check for elemental procedure pointer components. 2014-12-15 Janus Weil PR fortran/63727 * gfortran.dg/coarray_collectives_14.f90: Address FIXME item. From-SVN: r218751 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 8b10a486492..033582431d0 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2014-12-15 Janus Weil + + PR fortran/63727 + * resolve.c (resolve_actual_arglist): Check for elemental procedure + pointer components. + 2014-12-15 Janus Weil PR fortran/63674 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index fec36c9cdfa..ab13dc9f150 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -1740,6 +1740,7 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype, 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, procedure_type ptype, } } + 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)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a4b8957fd99..808f5a2ccde 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-12-15 Janus Weil + + PR fortran/63727 + * gfortran.dg/coarray_collectives_14.f90: Address FIXME item. + 2014-12-15 Richard Biener PR middle-end/64295 diff --git a/gcc/testsuite/gfortran.dg/coarray_collectives_14.f90 b/gcc/testsuite/gfortran.dg/coarray_collectives_14.f90 index c2f19398a58..6d53411e149 100644 --- a/gcc/testsuite/gfortran.dg/coarray_collectives_14.f90 +++ b/gcc/testsuite/gfortran.dg/coarray_collectives_14.f90 @@ -62,7 +62,7 @@ program test call co_reduce(caf, arg3) ! { dg-error "shall have two arguments" } call co_reduce(caf, dt%arg3) ! { dg-error "shall have two arguments" } call co_reduce(caf, elem) ! { dg-error "ELEMENTAL non-INTRINSIC procedure 'elem' is not allowed as an actual argument" } - call co_reduce(caf, dt%elem) ! { FIXME: "ELEMENTAL non-INTRINSIC procedure 'elem' is not allowed as an actual argument" } + call co_reduce(caf, dt%elem) ! { dg-error "ELEMENTAL procedure pointer component 'elem' is not allowed as an actual argument" } call co_reduce(caf, realo) ! { dg-error "A argument at .1. has type INTEGER.4. but the function passed as OPERATOR at .2. returns REAL.4." } call co_reduce(caf, dt%realo) ! { dg-error "A argument at .1. has type INTEGER.4. but the function passed as OPERATOR at .2. returns REAL.4." } call co_reduce(caf, int8) ! { dg-error "A argument at .1. has type INTEGER.4. but the function passed as OPERATOR at .2. returns INTEGER.8." }