re PR fortran/54435 (ICE with SELECT TYPE on a non-CLASS object)

2012-09-10  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/54435
	PR fortran/54443
	* match.c (gfc_match_select_type): Make sure to only access CLASS_DATA
	for BT_CLASS.

2012-09-10  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/54435
	PR fortran/54443
	* gfortran.dg/select_type_29.f03: New.

From-SVN: r191135
This commit is contained in:
Janus Weil 2012-09-10 14:10:12 +02:00
parent 2ebcf3ea10
commit bd3fe80051
4 changed files with 41 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2012-09-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/54435
PR fortran/54443
* match.c (gfc_match_select_type): Make sure to only access CLASS_DATA
for BT_CLASS.
2012-09-08 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/54208

View File

@ -5248,10 +5248,10 @@ gfc_match_select_type (void)
array, which can have a reference, from other expressions that
have references, such as derived type components, and are not
allowed by the standard.
TODO; see is it is sufficent to exclude component and substring
TODO: see if it is sufficent to exclude component and substring
references. */
class_array = expr1->expr_type == EXPR_VARIABLE
&& expr1->ts.type != BT_UNKNOWN
&& expr1->ts.type == BT_CLASS
&& CLASS_DATA (expr1)
&& (strcmp (CLASS_DATA (expr1)->name, "_data") == 0)
&& (CLASS_DATA (expr1)->attr.dimension

View File

@ -1,3 +1,9 @@
2012-09-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/54435
PR fortran/54443
* gfortran.dg/select_type_29.f03: New.
2012-09-10 Markus Trippelsdorf <markus@trippelsdorf.de>
PR middle-end/54515

View File

@ -0,0 +1,26 @@
! { dg-do compile }
!
! PR 54435: [4.7/4.8 Regression] ICE with SELECT TYPE on a non-CLASS object
!
! Contributed by xarthisius
subroutine foo(x)
integer :: x
select type (x) ! { dg-error "Selector shall be polymorphic" }
end select
end
! PR 54443: [4.7/4.8 Regression] Segmentation Fault when Compiling for code using Fortran Polymorphic Entities
!
! Contributed by Mark Beyer <mbeyer@cirrusaircraft.com>
program class_test
type hashnode
character(4) :: htype
end type
class(hashnode), pointer :: hp
select type(hp%htype) ! { dg-error "is not a named variable" }
end program