2007-08-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/32881
* expr.c (gfc_check_pointer_assign): If the rhs is the
initialization expression for the rhs, there is no error.
2007-08-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/32881
* gfortran.dg/pure_initializer_1.f90: New test.
From-SVN: r127611
+2007-08-18 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/32881
+ * expr.c (gfc_check_pointer_assign): If the rhs is the
+ initialization expression for the rhs, there is no error.
+
2007-08-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/32875
is_pure = gfc_pure (NULL);
- if (is_pure && gfc_impure_variable (lvalue->symtree->n.sym))
+ if (is_pure && gfc_impure_variable (lvalue->symtree->n.sym)
+ && lvalue->symtree->n.sym->value != rvalue)
{
gfc_error ("Bad pointer object in PURE procedure at %L", &lvalue->where);
return FAILURE;
+2007-08-18 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/32881
+ * gfortran.dg/pure_initializer_1.f90: New test.
+
2007-08-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/32875
--- /dev/null
+! { dg-do compile }
+! Tests the fix for PR32881, in which the initialization
+! of 'p' generated an error because the pureness of 'bar'
+! escaped.
+!
+! Contributed by Janne Blomqvist <jb@gcc.gnu.org>
+!
+subroutine foo ()
+ integer, pointer :: p => NULL()
+contains
+ pure function bar (a)
+ integer, intent(in) :: a
+ integer :: bar
+ bar = a
+ end function bar
+end subroutine foo
+