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

--- Comment #16 from janus at gcc dot gnu.org ---
(In reply to janus from comment #15)
> and also the patches from comment 8 and 10 don't help here.

... but the following does:


Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c    (revision 201520)
+++ gcc/fortran/expr.c    (working copy)
@@ -3936,8 +3936,7 @@ gfc_default_initializer (gfc_typespec *ts)
       if (comp->initializer)
     {
       ctor->expr = gfc_copy_expr (comp->initializer);
-      if ((comp->ts.type != comp->initializer->ts.type
-           || comp->ts.kind != comp->initializer->ts.kind)
+      if (!gfc_compare_types (&comp->ts, &comp->initializer->ts)
           && !comp->attr.pointer && !comp->attr.proc_pointer)
         gfc_convert_type_warn (ctor->expr, &comp->ts, 2, false);
     }

Reply via email to