Commit 236e3815 by Janus Weil

re PR fortran/56266 ([OOP] ICE on invalid in gfc_match_varspec)

2013-04-12  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/56266
	* primary.c (gfc_match_varspec): Turn gcc_assert into MATCH_ERROR.


2013-04-12  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/56266
	* gfortran.dg/typebound_proc_28.f03: New.

From-SVN: r197936
parent 701de10f
2013-04-12 Janus Weil <janus@gcc.gnu.org>
PR fortran/56266
* primary.c (gfc_match_varspec): Turn gcc_assert into MATCH_ERROR.
2013-04-12 Tobias Burnus <burnus@net-b.de>
PR fortran/56929
......
......@@ -1953,10 +1953,12 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag,
return MATCH_ERROR;
gcc_assert (!tail || !tail->next);
gcc_assert (primary->expr_type == EXPR_VARIABLE
|| (primary->expr_type == EXPR_STRUCTURE
&& primary->symtree && primary->symtree->n.sym
&& primary->symtree->n.sym->attr.flavor));
if (!(primary->expr_type == EXPR_VARIABLE
|| (primary->expr_type == EXPR_STRUCTURE
&& primary->symtree && primary->symtree->n.sym
&& primary->symtree->n.sym->attr.flavor)))
return MATCH_ERROR;
if (tbp->n.tb->is_generic)
tbp_sym = NULL;
......
2013-04-12 Janus Weil <janus@gcc.gnu.org>
PR fortran/56266
* gfortran.dg/typebound_proc_28.f03: New.
2013-04-12 Jeff Law <law@redhat.com>
* gcc.dg/tree-ssa/vrp87.c: Do not run test on ppc and xtensa
......
! { dg-do compile }
!
! PR 56266: [OOP] ICE on invalid in gfc_match_varspec
!
! Contributed by Andrew Benson <abensonca@gmail.com>
module t
implicit none
type nc
contains
procedure :: encM => em
end type nc
contains
double precision function em(self)
class(nc) :: self
em=0.
end function
double precision function cem(c)
type(nc) :: c
cem=c(i)%encM() ! { dg-error "Unclassifiable statement" }
end function
end module
! { dg-final { cleanup-modules "t" } }
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