URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [proc_ptr_comp_33.f90] - Rev 694
Compare with Previous | Blame | View Log
! { dg-do compile }!! PR 48095: [OOP] Invalid assignment to procedure pointer component not rejected!! Original test case by Arjen Markus <arjen.markus895@gmail.com>! Modified by Janus Weil <janus@gcc.gnu.org>module mimplicit nonetype :: rectanglereal :: width, heightprocedure(get_area_ai), pointer :: get_area => get_my_area ! { dg-error "Type/rank mismatch" }end type rectangleabstract interfacereal function get_area_ai( this )import :: rectangleclass(rectangle), intent(in) :: thisend function get_area_aiend interfacecontainsreal function get_my_area( this )type(rectangle), intent(in) :: thisget_my_area = 3.0 * this%width * this%heightend function get_my_areaend!-------------------------------------------------------------------------------program pimplicit nonetype :: rectanglereal :: width, heightprocedure(get_area_ai), pointer :: get_areaend type rectangleabstract interfacereal function get_area_ai (this)import :: rectangleclass(rectangle), intent(in) :: thisend function get_area_aiend interfacetype(rectangle) :: rectrect = rectangle (1.0, 2.0, get1)rect = rectangle (3.0, 4.0, get2) ! { dg-error "Type/rank mismatch" }containsreal function get1 (this)class(rectangle), intent(in) :: thisget1 = 1.0 * this%width * this%heightend function get1real function get2 (this)type(rectangle), intent(in) :: thisget2 = 2.0 * this%width * this%heightend function get2end! { dg-final { cleanup-modules "m" } }
