aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2011-09-22 11:32:11 +0200
committerJanus Weil <janus@gcc.gnu.org>2011-09-22 11:32:11 +0200
commit58c1ae3667e753a492bfa224ff9194b9e2ae01ff (patch)
tree422fdb8c37217bfc8598a7e3f79ac6671571df52 /gcc/fortran/expr.c
parent29ed4920e8f131a9c315be88ab1a9dcd9c5ccc59 (diff)
downloadgcc-58c1ae3667e753a492bfa224ff9194b9e2ae01ff.zip
gcc-58c1ae3667e753a492bfa224ff9194b9e2ae01ff.tar.gz
gcc-58c1ae3667e753a492bfa224ff9194b9e2ae01ff.tar.bz2
re PR fortran/41733 (Proc-pointer conformance checks: Elemental-proc-ptr => non-elemental-proc)
2011-09-22 Janus Weil <janus@gcc.gnu.org> PR fortran/41733 * expr.c (gfc_check_pointer_assign): Check for nonintrinsic elemental procedures. * interface.c (gfc_compare_interfaces): Rename 'intent_flag'. Check for PURE and ELEMENTAL attributes. (compare_actual_formal): Remove pureness check here. 2011-09-22 Janus Weil <janus@gcc.gnu.org> PR fortran/41733 * gfortran.dg/impure_actual_1.f90: Modified error message. * gfortran.dg/proc_ptr_32.f90: New. * gfortran.dg/proc_ptr_33.f90: New. From-SVN: r179080
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 3c09a2a..813a99d 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -3432,7 +3432,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
rvalue->symtree->name, &rvalue->where);
return FAILURE;
}
- /* Check for C727. */
+ /* Check for F08:C729. */
if (attr.flavor == FL_PROCEDURE)
{
if (attr.proc == PROC_ST_FUNCTION)
@@ -3448,6 +3448,14 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
rvalue->symtree->name, &rvalue->where) == FAILURE)
return FAILURE;
}
+ /* Check for F08:C730. */
+ if (attr.elemental && !attr.intrinsic)
+ {
+ gfc_error ("Nonintrinsic elemental procedure '%s' is invalid "
+ "in procedure pointer assigment at %L",
+ rvalue->symtree->name, &rvalue->where);
+ return FAILURE;
+ }
/* Ensure that the calling convention is the same. As other attributes
such as DLLEXPORT may differ, one explicitly only tests for the