[Patch, Fortran, OOP] PR 49638: [OOP] length parameter is ignored when overriding type bound character functions with constant length.

Thomas Koenig tkoenig@netcologne.de
Sun Aug 7 18:50:00 GMT 2011


Am 07.08.2011 19:05, schrieb Janus Weil:
> 2011/8/7 Thomas Koenig<tkoenig@netcologne.de>:
>> Am 07.08.2011 12:56, schrieb Janus Weil:
>>>
>>> +      /* Check string length.  */
>>> +      if (proc_target->result->ts.type == BT_CHARACTER
>>> +&&    proc_target->result->ts.u.cl&&    old_target->result->ts.u.cl
>>> +&&    gfc_dep_compare_expr (proc_target->result->ts.u.cl->length,
>>> +                                  old_target->result->ts.u.cl->length) !=
>>> 0)
>>> +       {
>>> +         gfc_error ("Character length mismatch between '%s' at '%L' "
>>> +                    "and overridden FUNCTION", proc->name,&where);
>>> +         return FAILURE;
>>> +       }
>>>       }
>>
>> Well, let's make this into (again, typing the patch directly into
>> e-mail)
>>
>>   [...]
>>
>> and then work on extending gfc_dep_compare_expr to return -3 for more cases.
>>   I can help with that.
>
> Alright then. How about this: I'll commit the attached verision of the
> patch (including your suggestions), and we start messing with the
> return values afterwards? Patch is regtested on
> x86_64-unknown-linux-gnu. I hope the test case is sufficient for a
> start.

This is OK.  Thanks for the patch (and for bearing with me ;-)

When extending the values of gfc_dep_compare_expr, we will need to go
through all its uses (making sure we change == -2 to <= -2).

Regards

	Thomas



More information about the Fortran mailing list