This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, fortran] PR51976 - [F2003] Support deferred-length character components of derived types (allocatable string length)

Paul Richard Thomas wrote:
The attached patch represents progress to date.  It fixes the original
problem in this PR and allows John Reid's version of
iso_varying_string/vocabulary_word_count.f90 to compile and run
correctly.  It even bootstraps and regtests!

Great! It seems as if 4.9 will get a much-wished feature soon after 4.8 is branched.

+   /* Is a parameter associated with a deferred type component.  */
+   unsigned deferred_parameter:1;

I quickly glanced at the patch and I am still not sure what "deferred_parameter" is exactly doing nor what "parameter" means in this context. I know a named constant ("PARAMETER") and (kind/length) type parameters of intrinsic types and (via "kind" and "len") derived types. Can you make it a bit clearer what this attribute is good for? – Do you need to handle it in module.c or in dump-parse-tree.c?

(A while later)

Looking at the patch a bit more carefully, "deferred_parameter" seems to be set for the hidden length component to a deferred-length character component. I think it is not really a (type) parameter; maybe "deferred_length_comp"?

         /* If it was not found, try the default initializer if there's any;
! 	 otherwise, it's an error.  */
         if (!comp_iter)
   	  if (comp->initializer)
--- 2349,2355 ----
         /* If it was not found, try the default initializer if there's any;
! 	 otherwise, it's an error unless this is a deferred parameter.  */

"a hidden deferred-length component"?

+ /* Add the hidden deferred length field. */

Or "field" ;-)

Otherwise, it looks okay to me – but I have not yet fully studied the patch nor applied and tried to break it ;-)
For instance, trying "select type(comp%str); case (character(len=*); print *, len(comp%str)" where "str" is "class(*)".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]