diff options
author | Paul Brook <paul@codesourcery.com> | 2005-01-22 15:24:09 +0000 |
---|---|---|
committer | Paul Brook <pbrook@gcc.gnu.org> | 2005-01-22 15:24:09 +0000 |
commit | 0dd973dd9710115f96420505591f65c5ab2445b4 (patch) | |
tree | 2a3848c0ca3a85aeeedecdf1905a38e016a7dc5a /gcc/fortran/resolve.c | |
parent | b8d5e92646dd8d2a4ea41770e734a29cfcbc1ea3 (diff) | |
download | gcc-0dd973dd9710115f96420505591f65c5ab2445b4.zip gcc-0dd973dd9710115f96420505591f65c5ab2445b4.tar.gz gcc-0dd973dd9710115f96420505591f65c5ab2445b4.tar.bz2 |
primary.c (gfc_match_rvalue): Only apply implicit type if variable does not have an explicit type.
2005-01-22 Paul Brook <paul@codesourcery.com>
* primary.c (gfc_match_rvalue): Only apply implicit type if variable
does not have an explicit type.
(gfc_match_variable): Resolve implicit derived types in all cases.
Resolve contained function types from their own namespace, not the
parent.
* resolve.c (resolve_contained_fntype): Remove duplicate sym->result
checking. Resolve from the contained namespace, not the parent.
testsuite/
* gfortran.dg/implicit_2.f90: New test.
From-SVN: r94066
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 0e17c4b..c3bf350 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -259,27 +259,13 @@ resolve_contained_fntype (gfc_symbol * sym, gfc_namespace * ns) || sym->attr.flavor == FL_VARIABLE)) return; - /* Try to find out of what type the function is. If there was an - explicit RESULT clause, try to get the type from it. If the - function is never defined, set it to the implicit type. If - even that fails, give up. */ + /* Try to find out of what the return type is. */ if (sym->result != NULL) sym = sym->result; if (sym->ts.type == BT_UNKNOWN) { - /* Assume we can find an implicit type. */ - t = SUCCESS; - - if (sym->result == NULL) - t = gfc_set_default_type (sym, 0, ns); - else - { - if (sym->result->ts.type == BT_UNKNOWN) - t = gfc_set_default_type (sym->result, 0, NULL); - - sym->ts = sym->result->ts; - } + t = gfc_set_default_type (sym, 0, ns); if (t == FAILURE) gfc_error ("Contained function '%s' at %L has no IMPLICIT type", |