Commit ade20620 by Tobias Burnus

re PR fortran/42922 (Wrongly rejected derived types with default initializers in PURE procedures 2)

2010-02-01  Tobias Burnus  <burnus@net-b.de>

        PR fortran/42922
        * decl.c (variable_decl): Allow default initializer in
        TYPE declarations in PURE functions.

2010-02-01  Tobias Burnus  <burnus@net-b.de>

        PR fortran/42922
        * gfortran.dg/pure_initializer_3.f90: News test.

From-SVN: r156433
parent 6eeea7a7
2010-02-01 Tobias Burnus <burnus@net-b.de>
PR fortran/42922
* decl.c (variable_decl): Allow default initializer in
TYPE declarations in PURE functions.
2010-01-31 Janus Weil <janus@gcc.gnu.org> 2010-01-31 Janus Weil <janus@gcc.gnu.org>
PR fortran/42888 PR fortran/42888
......
...@@ -1809,7 +1809,8 @@ variable_decl (int elem) ...@@ -1809,7 +1809,8 @@ variable_decl (int elem)
m = MATCH_ERROR; m = MATCH_ERROR;
} }
if (current_attr.flavor != FL_PARAMETER && gfc_pure (NULL)) if (current_attr.flavor != FL_PARAMETER && gfc_pure (NULL)
&& gfc_state_stack->state != COMP_DERIVED)
{ {
gfc_error ("Initialization of variable at %C is not allowed in " gfc_error ("Initialization of variable at %C is not allowed in "
"a PURE procedure"); "a PURE procedure");
......
2010-02-01 Tobias Burnus <burnus@net-b.de>
PR fortran/42922
* gfortran.dg/pure_initializer_3.f90: News test.
2010-01-31 Janus Weil <janus@gcc.gnu.org> 2010-01-31 Janus Weil <janus@gcc.gnu.org>
PR fortran/42888 PR fortran/42888
......
! { dg-do compile }
!
! PR fortran/42922
!
! Contributed by mrestelli@gmail.com
!
pure subroutine psub()
implicit none
type ilist
integer :: i = 0
end type ilist
type(ilist) :: x
x%i = 1
end subroutine psub
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