This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/51081] [F03] Proc-pointer assignment: Rejects valid internal proc
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 29 Jul 2012 19:04:25 +0000
- Subject: [Bug fortran/51081] [F03] Proc-pointer assignment: Rejects valid internal proc
- Auto-submitted: auto-generated
- References: <bug-51081-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51081
--- Comment #9 from janus at gcc dot gnu.org 2012-07-29 19:04:25 UTC ---
The following patch adds diagnostics to reject the invalid test case in comment
8:
Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c (revision 189929)
+++ gcc/fortran/expr.c (working copy)
@@ -3444,6 +3444,13 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_ex
"at %L", rvalue->symtree->name, &rvalue->where)
== FAILURE)
return FAILURE;
+ if (attr.intrinsic && gfc_intrinsic_actual_ok (rvalue->symtree->name,
+ attr.subroutine) == 0)
+ {
+ gfc_error ("Intrinsic '%s' at %L is invalid in procedure pointer "
+ "assignment", rvalue->symtree->name, &rvalue->where);
+ return FAILURE;
+ }
}
/* Check for F08:C730. */
if (attr.elemental && !attr.intrinsic)