Commit 0366dfe9 by Tobias Schlüter Committed by Tobias Schlüter

gfortran.h (gfc_get_namespace): Add second argument to prototype.

fortran/
* gfortran.h (gfc_get_namespace): Add second argument to prototype.
* intrinsic.c (gfc_intrinsic_init_1): Pass second argument to
gfc_get_namespace.
* module.c (mio_namespace_ref, load_needed): Likewise.
* parse.c (parse_interface, parse_contained): Likewise.  Here the
correct second argument matters.
* symbol.c (gfc_get_namespace): Add parent_types argument, only copy
parent's implicit types if this is set.
(gfc_symbol_init_2): Pass second argument to gfc_get_namespace.
* trans-common.c (build_common_decl): Likewise.

testsuite/
* gfortran.dg/implicit_3.f90: New test.

From-SVN: r95463
parent 6b211746
2005-02-23 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* gfortran.h (gfc_get_namespace): Add second argument to prototype.
* intrinsic.c (gfc_intrinsic_init_1): Pass second argument to
gfc_get_namespace.
* module.c (mio_namespace_ref, load_needed): Likewise.
* parse.c (parse_interface, parse_contained): Likewise. Here the
correct second argument matters.
* symbol.c (gfc_get_namespace): Add parent_types argument, only copy
parent's implicit types if this is set.
(gfc_symbol_init_2): Pass second argument to gfc_get_namespace.
* trans-common.c (build_common_decl): Likewise.
2005-02-23 Kazu Hirata <kazu@cs.umass.edu> 2005-02-23 Kazu Hirata <kazu@cs.umass.edu>
* intrinsic.h, st.c: Update copyright. * intrinsic.h, st.c: Update copyright.
......
...@@ -1619,7 +1619,7 @@ void gfc_free_st_label (gfc_st_label *); ...@@ -1619,7 +1619,7 @@ void gfc_free_st_label (gfc_st_label *);
void gfc_define_st_label (gfc_st_label *, gfc_sl_type, locus *); void gfc_define_st_label (gfc_st_label *, gfc_sl_type, locus *);
try gfc_reference_st_label (gfc_st_label *, gfc_sl_type); try gfc_reference_st_label (gfc_st_label *, gfc_sl_type);
gfc_namespace *gfc_get_namespace (gfc_namespace *); gfc_namespace *gfc_get_namespace (gfc_namespace *, int);
gfc_symtree *gfc_new_symtree (gfc_symtree **, const char *); gfc_symtree *gfc_new_symtree (gfc_symtree **, const char *);
gfc_symtree *gfc_find_symtree (gfc_symtree *, const char *); gfc_symtree *gfc_find_symtree (gfc_symtree *, const char *);
gfc_user_op *gfc_get_uop (const char *); gfc_user_op *gfc_get_uop (const char *);
......
...@@ -2241,7 +2241,7 @@ gfc_intrinsic_init_1 (void) ...@@ -2241,7 +2241,7 @@ gfc_intrinsic_init_1 (void)
nargs = nfunc = nsub = nconv = 0; nargs = nfunc = nsub = nconv = 0;
/* Create a namespace to hold the resolved intrinsic symbols. */ /* Create a namespace to hold the resolved intrinsic symbols. */
gfc_intrinsic_namespace = gfc_get_namespace (NULL); gfc_intrinsic_namespace = gfc_get_namespace (NULL, 0);
sizing = SZ_FUNCS; sizing = SZ_FUNCS;
add_functions (); add_functions ();
......
...@@ -2627,7 +2627,7 @@ mio_namespace_ref (gfc_namespace ** nsp) ...@@ -2627,7 +2627,7 @@ mio_namespace_ref (gfc_namespace ** nsp)
ns = (gfc_namespace *)p->u.pointer; ns = (gfc_namespace *)p->u.pointer;
if (ns == NULL) if (ns == NULL)
{ {
ns = gfc_get_namespace (NULL); ns = gfc_get_namespace (NULL, 0);
associate_integer_pointer (p, ns); associate_integer_pointer (p, ns);
} }
else else
...@@ -2878,7 +2878,7 @@ load_needed (pointer_info * p) ...@@ -2878,7 +2878,7 @@ load_needed (pointer_info * p)
the namespaces that hold the formal parameters of module the namespaces that hold the formal parameters of module
procedures. */ procedures. */
ns = gfc_get_namespace (NULL); ns = gfc_get_namespace (NULL, 0);
associate_integer_pointer (q, ns); associate_integer_pointer (q, ns);
} }
......
...@@ -1405,7 +1405,7 @@ parse_interface (void) ...@@ -1405,7 +1405,7 @@ parse_interface (void)
current_state = COMP_NONE; current_state = COMP_NONE;
loop: loop:
gfc_current_ns = gfc_get_namespace (current_interface.ns); gfc_current_ns = gfc_get_namespace (current_interface.ns, 0);
st = next_statement (); st = next_statement ();
switch (st) switch (st)
...@@ -2170,7 +2170,7 @@ parse_contained (int module) ...@@ -2170,7 +2170,7 @@ parse_contained (int module)
do do
{ {
gfc_current_ns = gfc_get_namespace (parent_ns); gfc_current_ns = gfc_get_namespace (parent_ns, 1);
gfc_current_ns->sibling = parent_ns->contained; gfc_current_ns->sibling = parent_ns->contained;
parent_ns->contained = gfc_current_ns; parent_ns->contained = gfc_current_ns;
......
...@@ -1531,10 +1531,11 @@ done: ...@@ -1531,10 +1531,11 @@ done:
this case, that symbol has been used as a host associated variable this case, that symbol has been used as a host associated variable
at some previous time. */ at some previous time. */
/* Allocate a new namespace structure. */ /* Allocate a new namespace structure. Copies the implicit types from
PARENT if PARENT_TYPES is set. */
gfc_namespace * gfc_namespace *
gfc_get_namespace (gfc_namespace * parent) gfc_get_namespace (gfc_namespace * parent, int parent_types)
{ {
gfc_namespace *ns; gfc_namespace *ns;
gfc_typespec *ts; gfc_typespec *ts;
...@@ -1556,7 +1557,7 @@ gfc_get_namespace (gfc_namespace * parent) ...@@ -1556,7 +1557,7 @@ gfc_get_namespace (gfc_namespace * parent)
ns->set_flag[i - 'a'] = 0; ns->set_flag[i - 'a'] = 0;
ts = &ns->default_type[i - 'a']; ts = &ns->default_type[i - 'a'];
if (ns->parent != NULL) if (parent_types && ns->parent != NULL)
{ {
/* Copy parent settings */ /* Copy parent settings */
*ts = ns->parent->default_type[i - 'a']; *ts = ns->parent->default_type[i - 'a'];
...@@ -2243,7 +2244,7 @@ void ...@@ -2243,7 +2244,7 @@ void
gfc_symbol_init_2 (void) gfc_symbol_init_2 (void)
{ {
gfc_current_ns = gfc_get_namespace (NULL); gfc_current_ns = gfc_get_namespace (NULL, 0);
} }
......
...@@ -288,7 +288,7 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init) ...@@ -288,7 +288,7 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init)
/* Create a namespace to store symbols for common blocks. */ /* Create a namespace to store symbols for common blocks. */
if (gfc_common_ns == NULL) if (gfc_common_ns == NULL)
gfc_common_ns = gfc_get_namespace (NULL); gfc_common_ns = gfc_get_namespace (NULL, 0);
gfc_get_symbol (com->name, gfc_common_ns, &common_sym); gfc_get_symbol (com->name, gfc_common_ns, &common_sym);
decl = common_sym->backend_decl; decl = common_sym->backend_decl;
......
2005-02-23 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* gfortran.dg/implicit_3.f90: New test.
2005-02-23 Alexandre Oliva <aoliva@redhat.com> 2005-02-23 Alexandre Oliva <aoliva@redhat.com>
* g++.dg/lookup/anon2.C: Don't let access checks make it look like * g++.dg/lookup/anon2.C: Don't let access checks make it look like
......
! { dg-do compile }
! Verify that INTERFACEs don't inherit the implicit types of the
! surrounding namespace.
implicit complex (i-k)
interface
function f(k,l)
! k should be default INTEGER
dimension l(k)
end function f
end interface
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment