------- Comment #1 from janus at gcc dot gnu dot org  2010-09-03 09:59 -------
Here is a patch to accept the type declaration in comment #0:

Index: decl.c
===================================================================
--- decl.c      (revision 163798)
+++ decl.c      (working copy)
@@ -1494,11 +1494,11 @@ build_struct (const char *name, gfc_charlen *cl, g
   gfc_component *c;
   gfc_try t = SUCCESS;

-  /* F03:C438/C439. If the current symbol is of the same derived type that
we're
-     constructing, it must have the pointer attribute.  */
+  /* F08:C440. If the current symbol is of the same derived type that we're
+     constructing, it must be POINTER or ALLOCATABLE.  */
   if ((current_ts.type == BT_DERIVED || current_ts.type == BT_CLASS)
       && current_ts.u.derived == gfc_current_block ()
-      && current_attr.pointer == 0)
+      && !current_attr.pointer && !current_attr.allocatable)
     {
       gfc_error ("Component at %C must have the POINTER attribute");
       return FAILURE;


-- 


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

Reply via email to