From db39d0c23d152eb9ce816dbb59bae15c19cc46aa Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Thu, 31 Jan 2008 22:20:47 +0000 Subject: re PR fortran/34910 (ICE on invalid assignments in doubly-contained functions) 2008-01-31 Paul Thomas PR fortran/34910 * expr.c (gfc_check_assign): It is an error to assign to a sibling procedure. 2008-01-31 Paul Thomas PR fortran/34910 * gfortran.dg/proc_assign_2.f90: New test. From-SVN: r131985 --- gcc/fortran/expr.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gcc/fortran/expr.c') diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index fb1886e..ac159f5 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -2705,6 +2705,15 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform) bad_proc = true; } + /* (iv) Host associated and not the function symbol or the + parent result. This picks up sibling references, which + cannot be entries. */ + if (!sym->attr.entry + && sym->ns == gfc_current_ns->parent + && sym != gfc_current_ns->proc_name + && sym != gfc_current_ns->parent->proc_name->result) + bad_proc = true; + if (bad_proc) { gfc_error ("'%s' at %L is not a VALUE", sym->name, &lvalue->where); -- cgit v1.1