diff options
author | Erik Edelmann <eedelman@acclab.helsinki.fi> | 2005-08-25 14:57:36 +0300 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2005-08-25 13:57:36 +0200 |
commit | 9e35b3869c9afa2b359e7e40bb6b11c284d8ba11 (patch) | |
tree | ff23e86abc5426d30a568b22fb2c942fab63915a | |
parent | a5e668d53debcd73c2cf1721f57f38f89291bb7b (diff) | |
download | gcc-9e35b3869c9afa2b359e7e40bb6b11c284d8ba11.zip gcc-9e35b3869c9afa2b359e7e40bb6b11c284d8ba11.tar.gz gcc-9e35b3869c9afa2b359e7e40bb6b11c284d8ba11.tar.bz2 |
re PR fortran/20363 (interface body has incorrect scope)
2005-08-25 Erik Edelmann <eedelman@acclab.helsinki.fi>
fortran/
PR fortran/20363
* symbol.c (find_special): Remove.
(build_sym, add_init_expr, attr_decl1): Remove calls to
find_special in favor of calls to gfc_get_symbol.
testsuite/
PR fortran/20363
* gfortran.dg/named_interface.f90: New.
From-SVN: r103486
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/decl.c | 30 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/named_interface.f90 | 9 |
4 files changed, 39 insertions, 12 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 271bbc4..1de65f5 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2005-08-25 Erik Edelmann <eedelman@acclab.helsinki.fi> + + PR fortran/20363 + * symbol.c (find_special): Remove. + (build_sym, add_init_expr, attr_decl1): Remove calls to + find_special in favor of calls to gfc_get_symbol. + 2005-08-24 Thomas Koenig <Thomas.Koenig@online.de> PR fortran/17758 diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 6062627..8c4ce58 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -530,29 +530,34 @@ syntax: } -/* Special subroutine for finding a symbol. If we're compiling a - function or subroutine and the parent compilation unit is an - interface, then check to see if the name we've been given is the - name of the interface (located in another namespace). If so, - return that symbol. If not, use gfc_get_symbol(). */ +/* Special subroutine for finding a symbol. Check if the name is found + in the current name space. If not, and we're compiling a function or + subroutine and the parent compilation unit is an interface, then check + to see if the name we've been given is the name of the interface + (located in another namespace). */ static int find_special (const char *name, gfc_symbol ** result) { gfc_state_data *s; + int i; + i = gfc_get_symbol (name, NULL, result); + if (i==0) + goto end; + if (gfc_current_state () != COMP_SUBROUTINE && gfc_current_state () != COMP_FUNCTION) - goto normal; + goto end; s = gfc_state_stack->previous; if (s == NULL) - goto normal; + goto end; if (s->state != COMP_INTERFACE) - goto normal; + goto end; if (s->sym == NULL) - goto normal; /* Nameless interface */ + goto end; /* Nameless interface */ if (strcmp (name, s->sym->name) == 0) { @@ -560,8 +565,8 @@ find_special (const char *name, gfc_symbol ** result) return 0; } -normal: - return gfc_get_symbol (name, NULL, result); +end: + return i; } @@ -616,7 +621,8 @@ build_sym (const char *name, gfc_charlen * cl, symbol_attribute attr; gfc_symbol *sym; - if (find_special (name, &sym)) + /* if (find_special (name, &sym)) */ + if (gfc_get_symbol (name, NULL, &sym)) return FAILURE; /* Start updating the symbol table. Add basic type attribute diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9ec4234..ad5c25f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-08-25 Erik Edelmann <eedelman@acclab.helsinki.fi> + + PR fortran/20363 + * gfortran.dg/named_interface.f90: New. + 2005-08-26 Maciej W. Rozycki <macro@linux-mips.org> * gcc.c-torture/execute/frame-address.c: New test. diff --git a/gcc/testsuite/gfortran.dg/named_interface.f90 b/gcc/testsuite/gfortran.dg/named_interface.f90 new file mode 100644 index 0000000..90fea80 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/named_interface.f90 @@ -0,0 +1,9 @@ +! { dg-do compile } +! PR 20363 +module snafu + interface foo + subroutine really_snafu (foo) + integer, intent (inout) :: foo + end subroutine really_snafu + end interface foo +end module snafu |