Commit e8ed3750 by Janus Weil

re PR fortran/59547 ([OOP] Problem with using tbp specification function in…

re PR fortran/59547 ([OOP] Problem with using tbp specification function in multiple class procedures)

2014-01-04  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/59547
	* class.c (add_proc_comp): Copy pure attribute.

2014-01-04  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/59547
	* gfortran.dg/typebound_proc_32.f90: New.

From-SVN: r206331
parent 953ff780
2014-01-04 Janus Weil <janus@gcc.gnu.org>
PR fortran/59547
* class.c (add_proc_comp): Copy pure attribute.
2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
Update copyright years
......
......@@ -714,9 +714,11 @@ add_proc_comp (gfc_symbol *vtype, const char *name, gfc_typebound_proc *tb)
if (tb->u.specific)
{
c->ts.interface = tb->u.specific->n.sym;
gfc_symbol *ifc = tb->u.specific->n.sym;
c->ts.interface = ifc;
if (!tb->deferred)
c->initializer = gfc_get_variable_expr (tb->u.specific);
c->attr.pure = ifc->attr.pure;
}
}
......
2014-01-04 Janus Weil <janus@gcc.gnu.org>
PR fortran/59547
* gfortran.dg/typebound_proc_32.f90: New.
2014-01-03 Marc Glisse <marc.glisse@inria.fr>
PR c++/58950
......
! { dg-do compile }
!
! PR 59547: [OOP] Problem with using tbp specification function in multiple class procedures
!
! Contributed by <bugs@miller-mohr.de>
module classes
implicit none
type :: base_class
contains
procedure, nopass :: get_num
procedure :: get_array, get_array2
end type
contains
pure integer function get_num()
get_num = 2
end function
function get_array( this ) result(array)
class(base_class), intent(in) :: this
integer, dimension( this%get_num() ) :: array
end function
function get_array2( this ) result(array)
class(base_class), intent(in) :: this
integer, dimension( this%get_num(), this%get_num() ) :: array
end function
end module
! { dg-final { cleanup-modules "classes" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment