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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2010.10.26 13:04:05
         AssignedTo|unassigned at gcc dot       |janus at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #1 from janus at gcc dot gnu.org 2010-10-26 13:04:05 UTC ---
Preliminary patch:


Index: gcc/fortran/interface.c
===================================================================
--- gcc/fortran/interface.c     (revision 165936)
+++ gcc/fortran/interface.c     (working copy)
@@ -1519,6 +1520,18 @@ compare_parameter (gfc_symbol *formal, gfc_expr *a
                   gfc_typename (&formal->ts));
       return 0;
     }
+    
+  /* F2003, 12.5.2.5.  */
+  if (formal->ts.type == BT_CLASS
+      && (CLASS_DATA (formal)->attr.pointer
+          || CLASS_DATA (formal)->attr.allocatable)
+      && actual->ts.type != BT_CLASS)
+    {
+      if (where)
+       gfc_error ("Actual argument to '%s' at %L must be polymorphic",
+                   formal->name, &actual->where);
+      return 0;
+    }

   if (formal->attr.codimension)
     {

Reply via email to