[Patch, fortran] PR31154 and PR31229 - use associated and imported function kind parameters

Paul Richard Thomas paul.richard.thomas@gmail.com
Fri Sep 7 14:58:00 GMT 2007

:ADDPATCH fortran:

At present, use associated or imported kind parameters that are
referenced in a function declaration cause an error because they
outrage gfc_match_init_expr.

The proposed patch fixes this by looking for a name, which is not
allowed in either the context of an interface or CONTAINS, setting
KIND to -1, as a flag, and bailing out.  This is tested after each
IMPORT and USE statement and the kind expression matched over again.
The moment that the parameter is either imported or use associated,
the match will succeed and a viable kind value will be added to the
function typespec.

It should be noted that only a parameter value can be matched in this
patch.  More complicated expressions still fail; furthermore, I have
not seen a satisfactory way of dealing with this yet but am open to
suggestions.  However, this patch is already a significant

The testcase encloses those of the contributors.

The ChangeLog entries are obvious but I have not had a moment to write
them today.

Regtested on Cygwin_NT/amd64 - OK for trunk?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr31229.diff
Type: application/octet-stream
Size: 6429 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070907/211df308/attachment.obj>

More information about the Gcc-patches mailing list