aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/parse.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2007-10-31 09:59:16 +0000
committerTobias Burnus <burnus@gcc.gnu.org>2007-10-31 10:59:16 +0100
commit182393f4f798c2ca212e2eba190e9a181f9787d8 (patch)
tree2284f5ec40ecf58838c860e9559b1e6731c7448b /gcc/fortran/parse.c
parenta3d977243dc773617c38a2d112da2c1332ac8287 (diff)
downloadgcc-182393f4f798c2ca212e2eba190e9a181f9787d8.zip
gcc-182393f4f798c2ca212e2eba190e9a181f9787d8.tar.gz
gcc-182393f4f798c2ca212e2eba190e9a181f9787d8.tar.bz2
re PR fortran/33897 (Incorrect host association in module)
2007-10-31 Paul Thomas <pault@gcc.gnu.org> PR fortran/33897 * decl.c (gfc_match_entry): Do not make ENTRY name global for contained procedures. * parse.c (gfc_fixup_sibling_symbols): Fix code for determining whether a procedure is external. 2007-10-31 Paul Thomas <pault@gcc.gnu.org> PR fortran/33897 * gfortran.dg/contained_3.f90: New. From-SVN: r129795
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r--gcc/fortran/parse.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index f357c7a..f60ea9a 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -2858,11 +2858,26 @@ gfc_fixup_sibling_symbols (gfc_symbol *sym, gfc_namespace *siblings)
continue;
old_sym = st->n.sym;
- if ((old_sym->attr.flavor == FL_PROCEDURE
- || old_sym->ts.type == BT_UNKNOWN)
- && old_sym->ns == ns
- && !old_sym->attr.contained
- && old_sym->attr.flavor != FL_NAMELIST)
+ if (old_sym->ns == ns
+ && !old_sym->attr.contained
+
+ /* By 14.6.1.3, host association should be excluded
+ for the following. */
+ && !(old_sym->attr.external
+ || (old_sym->ts.type != BT_UNKNOWN
+ && !old_sym->attr.implicit_type)
+ || old_sym->attr.flavor == FL_PARAMETER
+ || old_sym->attr.in_common
+ || old_sym->attr.in_equivalence
+ || old_sym->attr.data
+ || old_sym->attr.dummy
+ || old_sym->attr.result
+ || old_sym->attr.dimension
+ || old_sym->attr.allocatable
+ || old_sym->attr.intrinsic
+ || old_sym->attr.generic
+ || old_sym->attr.flavor == FL_NAMELIST
+ || old_sym->attr.proc == PROC_ST_FUNCTION))
{
/* Replace it with the symbol from the parent namespace. */
st->n.sym = sym;