re PR fortran/54778 ([OOP] an ICE on invalid OO code)

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

	PR fortran/54778
	* interface.c (matching_typebound_op): Check for 'class_ok' attribute.

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

	PR fortran/54778
	* gfortran.dg/class_53.f90: New.

From-SVN: r192005
This commit is contained in:
Janus Weil 2012-10-02 23:02:16 +02:00
parent 1504e3e1c4
commit 0a59e5832e
4 changed files with 30 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2012-10-02 Janus Weil <janus@gcc.gnu.org>
PR fortran/54778
* interface.c (matching_typebound_op): Check for 'class_ok' attribute.
2012-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/54667

View File

@ -3386,7 +3386,8 @@ matching_typebound_op (gfc_expr** tb_base,
if (base->expr->ts.type == BT_CLASS)
{
if (CLASS_DATA (base->expr) == NULL)
if (CLASS_DATA (base->expr) == NULL
|| !gfc_expr_attr (base->expr).class_ok)
continue;
derived = CLASS_DATA (base->expr)->ts.u.derived;
}

View File

@ -1,3 +1,8 @@
2012-10-02 Janus Weil <janus@gcc.gnu.org>
PR fortran/54778
* gfortran.dg/class_53.f90: New.
2012-10-02 Alexandre Oliva <aoliva@redhat.com>
PR debug/54551

View File

@ -0,0 +1,18 @@
! { dg-do compile }
!
! PR 54778: [OOP] an ICE on invalid OO code
!
! Contributed by Sylwester Arabas <slayoo@staszic.waw.pl>
implicit none
type :: arr_t
real :: at
end type
type(arr_t) :: this
class(arr_t) :: elem ! { dg-error "must be dummy, allocatable or pointer" }
elem = this ! { dg-error "Variable must not be polymorphic in intrinsic assignment" }
end