[Patch, fortran] PR54286 - [4.8 Regression] Accepts invalid proc-pointer assignments involving proc-ptr function result

Paul Richard Thomas paul.richard.thomas@gmail.com
Sat Jan 12 11:25:00 GMT 2013


Dear All,

It is something of an exaggeration to say that this PR is a regession,
although it is true that gcc-4.7 gives error messages for the testcase
in the correct places.  In fact, these messages disappear if IMPLICIT
INTEGER (a) at the start of the testcase.

The fix ensures that the interfaces are selected and checked
symmetrically in gfc_compare_interfaces.


The submitted testcase only checks the errors.  The other tests in the
testsuite adequately check the functionality of procedure pointer
assignments.

Bootstrapped and regtested on FC17/i86_64 - OK for trunk

Cheers

Paul

2013-01-12  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/54286
    * expr.c (gfc_check_pointer_assign): Ensure that both lvalue
    and rvalue interfaces are presented to gfc_compare_interfaces.
    Simplify references to interface names by using the symbols
    themselves. Call gfc_compare_interfaces with s1 and s2 inter-
    changed to overcome the asymmetry of this function. Do not
    repeat the check for the presence of s1 and s2.

2013-01-12  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/54286
    * gfortran.dg/proc_ptr_result_8.f90 : New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: submit.diff
Type: application/octet-stream
Size: 3763 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130112/ce4796ed/attachment.obj>


More information about the Gcc-patches mailing list