re PR fortran/41258 (internal compiler error: in find_typebound_proc_uop, at fortran/symbol.c:4575)

2009-09-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/41258
	* primary.c (gfc_match_varspec): Do not look for typebound
	procedures unless the derived type has a f2k_derived namespace.

2009-09-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/41258
	* gfortran.dg/typebound_proc_12.f90 : New test.

From-SVN: r151452
This commit is contained in:
Paul Thomas 2009-09-05 14:25:39 +00:00
parent f324f2ab50
commit 6d1e02179e
4 changed files with 28 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2009-09-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/41258
* primary.c (gfc_match_varspec): Do not look for typebound
procedures unless the derived type has a f2k_derived namespace.
2008-08-25 Paul Thomas <pault@gcc.gnu.org>
PR fortran/41062

View File

@ -1773,7 +1773,11 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag)
if (m != MATCH_YES)
return MATCH_ERROR;
tbp = gfc_find_typebound_proc (sym, &t, name, false);
if (sym->f2k_derived)
tbp = gfc_find_typebound_proc (sym, &t, name, false);
else
tbp = NULL;
if (tbp)
{
gfc_symbol* tbp_sym;

View File

@ -1,3 +1,8 @@
2009-09-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/41258
* gfortran.dg/typebound_proc_12.f90 : New test.
2009-09-03 Jakub Jelinek <jakub@redhat.com>
* gfortran.dg/proc_ptr_comp_18.f90: Removed.

View File

@ -0,0 +1,12 @@
! { dg-do compile }
! Test the fix for PR41258, where an ICE was caused by a search
! for a typebound procedure to resolve d%c%e
!
! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
!
TYPE a
TYPE(b), DIMENSION(:), POINTER :: c ! { dg-error "type that has not been declared" }
END TYPE
TYPE(a), POINTER :: d
CALL X(d%c%e) ! { dg-error "before it is defined" }
end