re PR fortran/55199 ([OOP] Equivalenced variable has wrong type when used with generic member function)

2012-11-04  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/55199
	* primary.c (gfc_match_varspec): Clear typespec if it cannot be
	determined at this point.

2012-11-04  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/55199
	* gfortran.dg/associate_12.f90: New.

From-SVN: r193136
This commit is contained in:
Janus Weil 2012-11-04 18:13:16 +01:00
parent f56f2d332c
commit 049bb74ea2
4 changed files with 42 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2012-11-04 Janus Weil <janus@gcc.gnu.org>
PR fortran/55199
* primary.c (gfc_match_varspec): Clear typespec if it cannot be
determined at this point.
2012-10-31 Janus Weil <janus@gcc.gnu.org>
PR fortran/53718

View File

@ -1975,6 +1975,8 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag,
gcc_assert (primary->symtree->n.sym->attr.referenced);
if (tbp_sym)
primary->ts = tbp_sym->ts;
else
gfc_clear_ts (&primary->ts);
m = gfc_match_actual_arglist (tbp->n.tb->subroutine,
&primary->value.compcall.actual);

View File

@ -1,3 +1,8 @@
2012-11-04 Janus Weil <janus@gcc.gnu.org>
PR fortran/55199
* gfortran.dg/associate_12.f90: New.
2012-11-03 Jack Howarth <howarth@bromo.med.uc.edu>
PR target/54255

View File

@ -0,0 +1,29 @@
! { dg-do compile }
!
! PR 55199: [OOP] Equivalenced variable has wrong type when used with generic member function
!
! Contributed by Rich Townsend <townsend@astro.wisc.edu>
module assoc_err_m
implicit none
type :: foo_t
contains
procedure :: func_1
generic :: func => func_1
end type
contains
real function func_1 (this)
class(foo_t), intent(in) :: this
end function
end module
program assoc_err
use assoc_err_m
implicit none
type(foo_t) :: f
associate(b => f%func())
print *, 1. + b
end associate
end program
! { dg-final { cleanup-modules "assoc_err_m" } }