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

Janus Weil janus@gcc.gnu.org
Sun Aug 7 18:49:00 GMT 2011


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.

Cheers,
Janus


2011-08-07  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/49638
	* dependency.c (are_identical_variables): For dummy arguments only
	check for equal names, not equal symbols.
	* interface.c (gfc_check_typebound_override): Add checking for rank
	and character length.

2011-08-07  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/49638
	* gfortran.dg/typebound_override_1.f90: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr49638_v3.diff
Type: text/x-diff
Size: 2578 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110807/fffef298/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: typebound_override_1.f90
Type: text/x-fortran
Size: 2317 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110807/fffef298/attachment-0001.bin>


More information about the Gcc-patches mailing list