[Patch, Fortran] SELECT TYPE with associate-name

Janus Weil janus@gcc.gnu.org
Mon Oct 5 14:33:00 GMT 2009


Daniel,

> +         else
> +           gfc_check_pointer_assign (code->expr1, code->expr2);
>
> -         gfc_check_pointer_assign (code->expr1, code->expr2);
>
> Your Changelog here says you don't want to call check_pointer_assign for
> CLASS assignments; it confuses me a little that you do this as well as fix
> check_pointer_assign to correctly handle CLASS as well.  But I guess that's
> alright and it is called sometimes with CLASS arguments anyways.

you're right to be confused. We indeed need to call
'gfc_check_pointer_assign' here, but I just realized that it is
important to do this already *before* calling 'resolve_class_assign'
(corrected now). The hunk that I changed inside
gfc_check_pointer_assign was just wrong.


>   /* Check for F03:C811.
>      TODO: Change error message once ASSOCIATE is implemented.  */
> -  if (expr->expr_type != EXPR_VARIABLE || expr->ref != NULL)
> +  if (expr1->expr_type != EXPR_VARIABLE || expr1->ref != NULL)
>
> That TODO is probably now void, isn't it?  But you didn't change the error
> message, so maybe even not?  Needs this further fixing?

Yeah, I just forgot to change the error message and remove the TODO.

Regarding Tobias' comments: The first one I will just ignore for now
(I think we have more problems with allocatable classes: already the
ALLOCATE statement seems to fail at runtime). About the second one: I
think you're right that we need to make the associate-name local. I
will have a look at Daniel's BLOCK implementation later today and see
if I can use it here.

Cheers,
Janus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: select_type_1005.diff
Type: text/x-diff
Size: 5973 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20091005/9f14fe27/attachment.bin>


More information about the Fortran mailing list