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/55825] [OOP] Bogus rank error with CLASS pointer assignment using structure constructors


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

--- Comment #3 from janus at gcc dot gnu.org 2012-12-28 19:23:38 UTC ---
The second error is fixed by the following:

Index: gcc/fortran/intrinsic.c
===================================================================
--- gcc/fortran/intrinsic.c    (revision 194743)
+++ gcc/fortran/intrinsic.c    (working copy)
@@ -4287,8 +4287,9 @@ gfc_convert_type_warn (gfc_expr *expr, gfc_typespe
   if (expr->ts.type == BT_UNKNOWN)
     goto bad;

-  if (expr->ts.type == BT_DERIVED && ts->type == BT_DERIVED
-      && gfc_compare_types (&expr->ts, ts))
+  if (expr->ts.type == BT_DERIVED
+      && (ts->type == BT_DERIVED || ts->type == BT_CLASS) 
+      && gfc_compare_types (ts, &expr->ts))
     return SUCCESS;

   sym = find_conv (&expr->ts, ts);


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