Commit 7d58b9e7 by Janus Weil

re PR fortran/45674 ([OOP] Undefined references for extended types)

2010-09-16  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/45674
	* interface.c (compare_parameter): Create vtab for actual argument,
	instead of formal (if needed).


2010-09-16  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/45674
	* gfortran.dg/class_dummy_2.f03: New.

From-SVN: r164338
parent f941c3e2
2010-09-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/45674
* interface.c (compare_parameter): Create vtab for actual argument,
instead of formal (if needed).
2010-09-15 Janus Weil <janus@gcc.gnu.org>
PR fortran/45577
......
......@@ -1428,10 +1428,10 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
&& actual->ts.u.derived && actual->ts.u.derived->ts.is_iso_c)
return 1;
if (formal->ts.type == BT_CLASS)
if (formal->ts.type == BT_CLASS && actual->ts.type == BT_DERIVED)
/* Make sure the vtab symbol is present when
the module variables are generated. */
gfc_find_derived_vtab (formal->ts.u.derived);
gfc_find_derived_vtab (actual->ts.u.derived);
if (actual->ts.type == BT_PROCEDURE)
{
......
2010-09-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/45674
* gfortran.dg/class_dummy_2.f03: New.
2010-09-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/45623
......
! { dg-do run }
!
! PR 45674: [OOP] Undefined references for extended types
!
! Contributed by Dietmar Ebner <dietmar.ebner@gmail.com>
module fails_mod
implicit none
type :: a_t
integer :: a
end type
type, extends(a_t) :: b_t
integer :: b
end type
contains
subroutine foo(a)
class(a_t) :: a
end subroutine foo
end module fails_mod
module fails_test
implicit none
contains
subroutine bar
use fails_mod
type(b_t) :: b
call foo(b)
end subroutine bar
end module fails_test
end
! { dg-final { cleanup-modules "fails_mod fails_test" } }
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