This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/51081] [F03] Proc-pointer assignment: Rejects valid internal proc


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]