This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/55825] [OOP] Bogus rank error with CLASS pointer assignment using structure constructors
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 28 Dec 2012 19:23:38 +0000
- Subject: [Bug fortran/55825] [OOP] Bogus rank error with CLASS pointer assignment using structure constructors
- Auto-submitted: auto-generated
- References: <bug-55825-4@http.gcc.gnu.org/bugzilla/>
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);