diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2007-08-18 10:47:58 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2007-08-18 10:47:58 +0000 |
commit | a595913e95d59f64670364c3dea31a4774c960f3 (patch) | |
tree | 0b6bac623a9a3068f4d3c207d395d5bdb5dce707 /gcc/fortran/expr.c | |
parent | 58fbb917c900243b8d3831e70f607ee12db54cbf (diff) | |
download | gcc-a595913e95d59f64670364c3dea31a4774c960f3.zip gcc-a595913e95d59f64670364c3dea31a4774c960f3.tar.gz gcc-a595913e95d59f64670364c3dea31a4774c960f3.tar.bz2 |
re PR fortran/32881 (PURE attribute escapes from contained procedure)
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
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index f0de19f..8c44028 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -2749,7 +2749,8 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue) 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; |