Bug 40869 - [F03] PPC assignment checking
Summary: [F03] PPC assignment checking
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: janus
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2009-07-27 07:18 UTC by janus
Modified: 2009-08-27 19:53 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-08-25 17:49:45


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description janus 2009-07-27 07:18:46 UTC
This PR is meant to track one leftover item related to procedure pointer components: No pointer assignment checking is performed yet when a PPC is involved, cf. the TODO comment in expr.c (gfc_check_pointer_assign).

Short test case:


implicit none

type :: t1
  procedure(integer), pointer, nopass :: ppc
end type

type :: t2
  procedure(real), pointer, nopass :: ppc
end type

type(t1) :: o1
type(t2) :: o2
procedure(logical),pointer :: pp1
procedure(complex),pointer :: pp2

pp1 => pp2
o1%ppc => pp1
pp2 => o2%ppc
o1%ppc => o2%ppc

end


All four pointer assignments in this example are invalid, but only the first one is caught.
Comment 1 janus 2009-08-27 19:49:03 UTC
Subject: Bug 40869

Author: janus
Date: Thu Aug 27 19:48:46 2009
New Revision: 151147

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151147
Log:
2009-08-27  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/40869
	* expr.c (gfc_check_pointer_assign): Enable interface check for
	pointer assignments involving procedure pointer components.
	* gfortran.h (gfc_compare_interfaces): Modified prototype.
	* interface.c (gfc_compare_interfaces): Add argument 'name2', to be
	used instead of s2->name. Don't rely on the proc_pointer attribute,
	but instead on the flags handed to this function.
	(check_interface1,compare_parameter): Add argument for
	gfc_compare_interfaces.
	* resolve.c (check_generic_tbp_ambiguity): Ditto.

2009-08-27  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/40869
	* gfortran.dg/proc_ptr_comp_20.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/proc_ptr_comp_20.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/interface.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog

Comment 2 janus 2009-08-27 19:53:12 UTC
Fixed with r151147. Closing.