diff options
| author | Paul Thomas <pault@gcc.gnu.org> | 2006-01-23 05:07:52 +0000 |
|---|---|---|
| committer | Paul Thomas <pault@gcc.gnu.org> | 2006-01-23 05:07:52 +0000 |
| commit | cda7004bb4836fa9e3c7f892c0fc0de3c81d176f (patch) | |
| tree | 8ebb2f15eb3f79dbe90e03b880a60ebda46f94d8 /gcc/fortran/decl.c | |
| parent | 0743efe14908ff3e39f14de636d1526e4813b4ca (diff) | |
| download | gcc-cda7004bb4836fa9e3c7f892c0fc0de3c81d176f.zip gcc-cda7004bb4836fa9e3c7f892c0fc0de3c81d176f.tar.gz gcc-cda7004bb4836fa9e3c7f892c0fc0de3c81d176f.tar.bz2 | |
re PR fortran/25901 (overloaded function is rejected)
2005-01-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/25901
* decl.c (get_proc_name): Replace subroutine and function
attributes in "already defined" test by the formal arglist
pointer being non-NULL.
Fix regression in testing of admissability of attributes.
* symbol.c (gfc_add_attribute): If the current_attr has
non-zero intent, do not do the check for a dummy being
used.
* decl.c (attr_decl1): Add current_attr.intent as the
third argument in the call to gfc_add_attribute.
* gfortran.h: Add the third argument to the prototype
for gfc_add_attribute.
2005-01-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/25901
* gfortran.dg/internal references_2.f90: New test.
Fix regression in testing of admissability of attributes.
* gfortran.dg/intent_used_1.f90: New test.
From-SVN: r110106
Diffstat (limited to 'gcc/fortran/decl.c')
| -rw-r--r-- | gcc/fortran/decl.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 282ca73..7a80f81 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -611,10 +611,14 @@ get_proc_name (const char *name, gfc_symbol ** result) if (sym && !sym->new && gfc_current_state () != COMP_INTERFACE) { - /* Trap another encompassed procedure with the same name. */ + /* Trap another encompassed procedure with the same name. All + these conditions are necessary to avoid picking up an entry + whose name clashes with that of the encompassing procedure; + this is handled using gsymbols to register unique,globally + accessible names. */ if (sym->attr.flavor != 0 && sym->attr.proc != 0 - && (sym->attr.subroutine || sym->attr.function)) + && sym->formal) gfc_error_now ("Procedure '%s' at %C is already defined at %L", name, &sym->declared_at); @@ -3202,7 +3206,7 @@ attr_decl1 (void) goto cleanup; } - if (gfc_add_attribute (&sym->attr, &var_locus) == FAILURE) + if (gfc_add_attribute (&sym->attr, &var_locus, current_attr.intent) == FAILURE) { m = MATCH_ERROR; goto cleanup; |
