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/52968] [OOP] Call to type-bound procedure wrongly rejected


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

--- Comment #3 from janus at gcc dot gnu.org 2012-04-13 14:02:05 UTC ---
This bug is similar to PR51995, and in fact the patch from comment #2 above
seems to supersede the solution given there (which could be removed as a
consequence):

Index: gcc/fortran/class.c
===================================================================
--- gcc/fortran/class.c    (revision 186413)
+++ gcc/fortran/class.c    (working copy)
@@ -541,8 +541,7 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_a
       fclass->refs++;
       fclass->ts.type = BT_UNKNOWN;
       fclass->attr.abstract = ts->u.derived->attr.abstract;
-      if (ts->u.derived->f2k_derived)
-    fclass->f2k_derived = gfc_get_namespace (NULL, 0);
+      fclass->f2k_derived = gfc_get_namespace (NULL, 0);
       if (gfc_add_flavor (&fclass->attr, FL_DERIVED,
       NULL, &gfc_current_locus) == FAILURE)
     return FAILURE;
@@ -579,8 +578,6 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_a
       c->attr.access = ACCESS_PRIVATE;
       c->attr.pointer = 1;
     }
-  else if (!fclass->f2k_derived)
-    fclass->f2k_derived = gfc_get_namespace (NULL, 0);

   /* Since the extension field is 8 bit wide, we can only have
      up to 255 extension levels.  */


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