aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/parse.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2007-03-11 16:17:32 +0000
committerPaul Thomas <pault@gcc.gnu.org>2007-03-11 16:17:32 +0000
commitf68abf4a59a96eeef1d1db82b1d0c5cc2551b438 (patch)
treed7af43c9835e239334294a4cde209293436d69b3 /gcc/fortran/parse.c
parent13338552e20fc9327a4bf620715939db13c23ba6 (diff)
downloadgcc-f68abf4a59a96eeef1d1db82b1d0c5cc2551b438.zip
gcc-f68abf4a59a96eeef1d1db82b1d0c5cc2551b438.tar.gz
gcc-f68abf4a59a96eeef1d1db82b1d0c5cc2551b438.tar.bz2
re PR fortran/30883 ([4.1/4.2 only] procedure with dummy procedure f1 rejected with implicit none)
2007-03-11 Paul Thomas <pault@gcc.gnu.org> PR fortran/30883 * parse.c (parse_interface): Use the default types from the formal namespace if a function or its result do not have a type after parsing the specification statements. 2007-03-11 Paul Thomas <pault@gcc.gnu.org> PR fortran/30883 * gfortran.dg/interface_11.f90: New test. From-SVN: r122822
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r--gcc/fortran/parse.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 6e36ea2..2d17167 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -1782,6 +1782,20 @@ decl:
/* Read data declaration statements. */
st = parse_spec (ST_NONE);
+ /* Since the interface block does not permit an IMPLICIT statement,
+ the default type for the function or the result must be taken
+ from the formal namespace. */
+ if (new_state == COMP_FUNCTION)
+ {
+ if (prog_unit->result == prog_unit
+ && prog_unit->ts.type == BT_UNKNOWN)
+ gfc_set_default_type (prog_unit, 1, prog_unit->formal_ns);
+ else if (prog_unit->result != prog_unit
+ && prog_unit->result->ts.type == BT_UNKNOWN)
+ gfc_set_default_type (prog_unit->result, 1,
+ prog_unit->formal_ns);
+ }
+
if (st != ST_END_SUBROUTINE && st != ST_END_FUNCTION)
{
gfc_error ("Unexpected %s statement at %C in INTERFACE body",