diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2006-11-24 22:22:40 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2006-11-24 22:22:40 +0000 |
commit | 536afc35bcf3c814347f9f4a88682e9f345d354f (patch) | |
tree | e7282ffa93de4569b618b2f353edc62bd74a97eb /gcc/fortran/parse.c | |
parent | e7c1c8d1a18a2551c91254fc2b92f69c788c077b (diff) | |
download | gcc-536afc35bcf3c814347f9f4a88682e9f345d354f.zip gcc-536afc35bcf3c814347f9f4a88682e9f345d354f.tar.gz gcc-536afc35bcf3c814347f9f4a88682e9f345d354f.tar.bz2 |
re PR fortran/20880 (USE association of procedure's own interface)
2006-11-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/20880
* parse.c (parse_interface): Error if procedure name is that of
encompassing scope.
* resolve.c (resolve_fl_procedure): Error if procedure is
ambiguous.
PR fortran/29387
* interface.c (compare_actual_formal): Add missing condition
that 'where' be present for error that asserts that actual
arguments be definable.
2006-11-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/20880
* gfortran.dg/interface_3.f90: New test.
PR fortran/29387
* gfortran.dg/generic_8.f90: New test.
From-SVN: r119173
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r-- | gcc/fortran/parse.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index 1d02c20..eebe448 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -1694,6 +1694,7 @@ parse_interface (void) gfc_interface_info save; gfc_state_data s1, s2; gfc_statement st; + locus proc_locus; accept_statement (ST_INTERFACE); @@ -1781,6 +1782,7 @@ loop: accept_statement (st); prog_unit = gfc_new_block; prog_unit->formal_ns = gfc_current_ns; + proc_locus = gfc_current_locus; decl: /* Read data declaration statements. */ @@ -1796,8 +1798,15 @@ decl: current_interface = save; gfc_add_interface (prog_unit); - pop_state (); + + if (current_interface.ns + && current_interface.ns->proc_name + && strcmp (current_interface.ns->proc_name->name, + prog_unit->name) == 0) + gfc_error ("INTERFACE procedure '%s' at %L has the same name as the " + "enclosing procedure", prog_unit->name, &proc_locus); + goto loop; done: |