[Bug fortran/46301] [4.6 Regression] Missing diagnosis for "len=:"

kargl at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Nov 4 17:48:00 GMT 2010


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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #2 from kargl at gcc dot gnu.org 2010-11-04 17:47:49 UTC ---
Index: resolve.c
===================================================================
--- resolve.c   (revision 166318)
+++ resolve.c   (working copy)
@@ -11739,6 +11739,15 @@ resolve_symbol (gfc_symbol *sym)
   gfc_namespace *ns;
   gfc_component *c;

+  /* FIXME: Until deferred type parameters are resolved and translated to
+     to something useful, just bail out. */
+  if (sym->ts.type == BT_CHARACTER && sym->ts.deferred)
+    {
+      gfc_error ("Deferred type parameter at %L is unsupported",
+                &sym->declared_at);
+      return;
+    }
+
   /* Avoid double resolution of function result symbols.  */
   if ((sym->result || sym->attr.result) && !sym->attr.dummy
       && (sym->ns != gfc_current_ns))


troutmask:sgk[232] gfc4x -o z g.f90
g.f90:2.40:

      character(len=:), allocatable :: S
                                        1
Error: Deferred type parameter at (1) is unsupported

Also note that the testcase fails to compile if
one asks for Fortran conformance with or without this 
patch. 

troutmask:sgk[233] gfc4x -o z -std=f95 g.f90
g.f90:2.21:

      character(len=:), allocatable :: S
                     1
Error: Fortran 2003: deferred type parameter at (1)
g.f90:4.6:

      S=S(3:)
      1
Error: Unclassifiable statement at (1)
g.f90:3.8:

      S='abcdef'
        1
Error: Can't convert CHARACTER(1) to REAL(4) at (1)



More information about the Gcc-bugs mailing list