From 9ef860baf466d7e98f1cfe2d8081400db1caf8c0 Mon Sep 17 00:00:00 2001 From: pault Date: Tue, 8 May 2007 14:40:58 +0000 Subject: 2007-05-08 Paul Thomas PR fortran/31630 * resolve.c (resolve_symbol): Remove the flagging mechanism from the formal namespace resolution and instead check that the formal namespace is not the current namespace. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124550 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/resolve.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'gcc/fortran/resolve.c') diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 4ec9a921c4a..5c5d40bf6d5 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -6136,9 +6136,7 @@ resolve_fl_parameter (gfc_symbol *sym) static void resolve_symbol (gfc_symbol *sym) { - /* Zero if we are checking a formal namespace. */ - static int formal_ns_flag = 1; - int formal_ns_save, check_constant, mp_flag; + int check_constant, mp_flag; gfc_symtree *symtree; gfc_symtree *this_symtree; gfc_namespace *ns; @@ -6345,18 +6343,9 @@ resolve_symbol (gfc_symbol *sym) formal_arg_flag = 0; - /* Resolve formal namespaces. The symbols in formal namespaces that - themselves are from procedures in formal namespaces will not stand - resolution, except when they are use associated. - TODO: Fix the symbols in formal namespaces so that resolution can - be done unconditionally. */ - if (formal_ns_flag && sym != NULL && sym->formal_ns != NULL) - { - formal_ns_save = formal_ns_flag; - formal_ns_flag = sym->attr.use_assoc ? 1 : 0; - gfc_resolve (sym->formal_ns); - formal_ns_flag = formal_ns_save; - } + /* Resolve formal namespaces. */ + if (sym->formal_ns && sym->formal_ns != gfc_current_ns) + gfc_resolve (sym->formal_ns); /* Check threadprivate restrictions. */ if (sym->attr.threadprivate && !sym->attr.save -- cgit v1.2.1