Patchwork [Fortran,committed] Print not-implemented error for deferred-length character components

login
register
mail settings
Submitter Tobias Burnus
Date Dec. 15, 2011, 3:26 p.m.
Message ID <4EEA11B5.9000703@net-b.de>
Download mbox | patch
Permalink /patch/131668/
State New
Headers show

Comments

Tobias Burnus - Dec. 15, 2011, 3:26 p.m.
Dear all,

while deferred-length character variables work in principle (though 
there are issues), deferred-length components have not been implemented 
at all. Currently, one gets an ICE if one tries to use them.

Dominique proposed to print an error (sorry not yet implemented), which 
makes sense as we have at least 5 PRs about this issue.

Committed as Rev 182372 to the trunk and as Rev.182373 to the 4.6 branch.

Tobias

Patch

Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog	(revision 182371)
+++ gcc/fortran/ChangeLog	(working copy)
@@ -1,5 +1,14 @@ 
 2011-12-15  Tobias Burnus  <burnus@net-b.de>
 
+	PR fortran/51550
+	PR fortran/47545
+	PR fortran/49050
+	PR fortran/51075	
+	* resolve.c (resolve_fl_derived0): Print not-implemented error
+	for deferred-length character components.
+
+2011-12-15  Tobias Burnus  <burnus@net-b.de>
+
 	* primary.c (gfc_match_varspec): Match array spec for
 	polymorphic coarrays.
 	(gfc_match_rvalue): If a symbol of unknown flavor has a
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c	(revision 182371)
+++ gcc/fortran/resolve.c	(working copy)
@@ -11432,6 +11432,14 @@  resolve_fl_derived0 (gfc_symbol *sym)
 
   for (c = sym->components; c != NULL; c = c->next)
     {
+      /* See PRs 51550, 47545, 48654, 49050, 51075 - and 45170.  */
+      if (c->ts.type == BT_CHARACTER && c->ts.deferred)
+	{
+	  gfc_error ("Deferred-length character component '%s' at %L is not "
+		     "yet supported", c->name, &c->loc);
+	  return FAILURE;
+	}
+
       /* F2008, C442.  */
       if ((!sym->attr.is_class || c != sym->components)
 	  && c->attr.codimension