[Patch, Fortran] SELECT TYPE with associate-name

Janus Weil janus@gcc.gnu.org
Tue Oct 6 12:15:00 GMT 2009

> +      gfc_error ("Selector is not a named variable in SELECT TYPE statement "
> +                "at %C. Please use associate-name.");
> Remove the trailing fullstop. I am tempted to add an "an" before
> associated name or alternately, I also like the idea of "ifort" to write
> "associate-name=>":
> "If selector expression in SELECT TYPE is not a named variable,
> associate-name=> shall appear."
> Maybe the following? "Selector in SELECT TYPE at %C is not a named
> variable; use associate-name=>"

Alright, I changed this error message, and I also extended the
implementation such that every SELECT TYPE statement is put into a
BLOCK, with the effect that the associate-name for the selector as
well as the temporaries for the TYPE cases are local to that block.

The important stuff happens in gfc_match_select type, where I set up
the local namespace for the block, and in resolve_select_type, where I
generate the BLOCK code. This makes use of Daniel's BLOCK
implementation, and I hope it is in the sense of the inventor :)

Is the patch ok in the attached form? (I have regtested it again successfully.)

Btw, since I was just looking at it, one question to Daniel regarding
the BLOCK patch:
The patch introduces a field 'construct_entities' in gfc_namespace,
which is set in 'parse_block_construct', but does not seem to be used
anywhere else. Is this planned to be used in the future, or is it
superfluous and was forgotten to be removed?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: select_type_1006.diff
Type: text/x-diff
Size: 9323 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20091006/dbbcc218/attachment.bin>

More information about the Gcc-patches mailing list