Commit bcb9f394 by Tobias Burnus Committed by Tobias Burnus

re PR fortran/57535 ([OOP] ICE when allocating a CLASS function-result variable)

2013-06-11  Tobias Burnus  <burnus@net-b.de>

        PR fortran/57535
        * trans-array.c (build_class_array_ref): Fix ICE for
        function result variables.

2013-06-11  Tobias Burnus  <burnus@net-b.de>

        PR fortran/57535
        * gfortran.dg/class_array_18.f90: New.

From-SVN: r199958
parent dca61c7e
2013-06-11 Tobias Burnus <burnus@net-b.de>
PR fortran/57535
* trans-array.c (build_class_array_ref): Fix ICE for
function result variables.
2013-06-08 Tobias Burnus <burnus@net-b.de> 2013-06-08 Tobias Burnus <burnus@net-b.de>
PR fortran/37336 PR fortran/37336
......
...@@ -2991,7 +2991,13 @@ build_class_array_ref (gfc_se *se, tree base, tree index) ...@@ -2991,7 +2991,13 @@ build_class_array_ref (gfc_se *se, tree base, tree index)
if (ts == NULL) if (ts == NULL)
return false; return false;
if (class_ref == NULL) if (class_ref == NULL && expr->symtree->n.sym->attr.function
&& expr->symtree->n.sym == expr->symtree->n.sym->result)
{
gcc_assert (expr->symtree->n.sym->backend_decl == current_function_decl);
decl = gfc_get_fake_result_decl (expr->symtree->n.sym, 0);
}
else if (class_ref == NULL)
decl = expr->symtree->n.sym->backend_decl; decl = expr->symtree->n.sym->backend_decl;
else else
{ {
......
2013-06-11 Tobias Burnus <burnus@net-b.de>
PR fortran/57535
* gfortran.dg/class_array_18.f90: New.
2013-06-11 Jan Hubicka <jh@suse.cz> 2013-06-11 Jan Hubicka <jh@suse.cz>
PR c++/57551 PR c++/57551
......
! { dg-do compile }
!
! PR fortran/57535
!
program test
implicit none
type t
integer :: ii = 55
end type t
contains
function func2()
class(t), allocatable :: func2(:)
allocate(func2(3))
func2%ii = [111,222,333]
end function func2
end program test
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