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/47768] ICE: printing a derived-type variable with proc-pointer components


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47768

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011.02.16 22:37:22
         AssignedTo|unassigned at gcc dot       |janus at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #3 from janus at gcc dot gnu.org 2011-02-16 22:37:22 UTC ---
(In reply to comment #2)
> So, pointer components are indeed forbidden. All that's left to do here is to
> also reject procedure pointers and procedure pointer components.

Here is a patch for rejecting PPCs:


Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c       (revision 170222)
+++ gcc/fortran/resolve.c       (working copy)
@@ -8091,6 +8091,13 @@ resolve_transfer (gfc_code *code)
          return;
        }

+      if (ts->u.derived->attr.proc_pointer_comp)
+       {
+         gfc_error ("Data transfer element at %L cannot have "
+                    "procedure pointer components", &code->loc);
+         return;
+       }
+
       if (ts->u.derived->attr.alloc_comp)
        {
          gfc_error ("Data transfer element at %L cannot have "



Procedure pointers are already rejected with:

print *,pp
          1
Error: Function 'pp' requires an argument list at (1)


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