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

--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-04-23 
12:59:24 UTC ---
(In reply to comment #7)
> As of yesterday, the testcase in comment #1 compiles and runs
> successfully.  We now just need the error message for the original problem.


Untested patch:

--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -1626,5 +1626,8 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr

-  if (c->attr.pointer)
+  if (c->attr.pointer
+          || (c->ts.type == BT_CLASS && CLASS_DATA (c)
+              && CLASS_DATA (c)->attr.class_pointer))
     {
-      if (c->as->type != AS_DEFERRED)
+      if ((c->ts.type == BT_CLASS && CLASS_DATA (c)->as->type != AS_DEFERRED)
+         || (c->ts.type != BT_CLASS &&  c->as->type != AS_DEFERRED))
        {
@@ -1635,5 +1638,8 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr 
     }
-  else if (c->attr.allocatable)
+  else if (c->attr.allocatable
+          || (c->ts.type == BT_CLASS && CLASS_DATA (c)
+              && CLASS_DATA (c)->attr.allocatable))
     {
-      if (c->as->type != AS_DEFERRED)
+      if ((c->ts.type == BT_CLASS && CLASS_DATA (c)->as->type != AS_DEFERRED)
+         || (c->ts.type != BT_CLASS &&  c->as->type != AS_DEFERRED))
        {

Reply via email to