Commit ff604888 by Paul Thomas

re PR fortran/20896 (ambiguous interface not detected)

2007-01-02  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/20896
	* interface.c (check_sym_interfaces): Remove call to
	resolve_global_procedure.
	gfortran.h : Remove prototype for resolve_global_procedure.
	resolve.c (resolve_global_procedure): Add static attribute
	to function declaration.

2007-01-02  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/20896
	* gfortran.dg/interface_10.f90: Remove.

From-SVN: r120342
parent 06d40de8
2007-01-02 Paul Thomas <pault@gcc.gnu.org>
PR fortran/20896
* interface.c (check_sym_interfaces): Remove call to
resolve_global_procedure.
gfortran.h : Remove prototype for resolve_global_procedure.
resolve.c (resolve_global_procedure): Add static attribute
to function declaration.
2007-01-01 Steven G. Kargl <kargls@comcast.net> 2007-01-01 Steven G. Kargl <kargls@comcast.net>
* ChangeLog: Copy to ... * ChangeLog: Copy to ...
......
...@@ -2032,7 +2032,6 @@ void gfc_free_statement (gfc_code *); ...@@ -2032,7 +2032,6 @@ void gfc_free_statement (gfc_code *);
void gfc_free_statements (gfc_code *); void gfc_free_statements (gfc_code *);
/* resolve.c */ /* resolve.c */
void resolve_global_procedure (gfc_symbol *, locus *, int);
try gfc_resolve_expr (gfc_expr *); try gfc_resolve_expr (gfc_expr *);
void gfc_resolve (gfc_namespace *); void gfc_resolve (gfc_namespace *);
void gfc_resolve_blocks (gfc_code *, gfc_namespace *); void gfc_resolve_blocks (gfc_code *, gfc_namespace *);
......
...@@ -1016,11 +1016,6 @@ check_sym_interfaces (gfc_symbol * sym) ...@@ -1016,11 +1016,6 @@ check_sym_interfaces (gfc_symbol * sym)
if (sym->ns != gfc_current_ns) if (sym->ns != gfc_current_ns)
return; return;
if (sym->attr.if_source == IFSRC_IFBODY
&& sym->attr.flavor == FL_PROCEDURE
&& !sym->attr.mod_proc)
resolve_global_procedure (sym, &sym->declared_at, sym->attr.subroutine);
if (sym->generic != NULL) if (sym->generic != NULL)
{ {
sprintf (interface_name, "generic interface '%s'", sym->name); sprintf (interface_name, "generic interface '%s'", sym->name);
......
...@@ -1235,7 +1235,7 @@ find_noncopying_intrinsics (gfc_symbol * fnsym, gfc_actual_arglist * actual) ...@@ -1235,7 +1235,7 @@ find_noncopying_intrinsics (gfc_symbol * fnsym, gfc_actual_arglist * actual)
reference. The corresponding code that is called in creating reference. The corresponding code that is called in creating
global entities is parse.c. */ global entities is parse.c. */
void static void
resolve_global_procedure (gfc_symbol *sym, locus *where, int sub) resolve_global_procedure (gfc_symbol *sym, locus *where, int sub)
{ {
gfc_gsymbol * gsym; gfc_gsymbol * gsym;
......
2007-01-02 Paul Thomas <pault@gcc.gnu.org>
PR fortran/20896
* gfortran.dg/interface_10.f90: Remove.
2007-01-01 Roger Sayle <roger@eyesopen.com> 2007-01-01 Roger Sayle <roger@eyesopen.com>
* gcc.dg/fold-eqxor-4.c: New test case. * gcc.dg/fold-eqxor-4.c: New test case.
! { dg-do compile }
! Test the fix for PR20896 in which the ambiguous use
! of p was not detected.
!
! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
!
INTERFACE g
SUBROUTINE s1(p) ! { dg-error "is already being used" }
INTERFACE
SUBROUTINE p
END
END INTERFACE
END
SUBROUTINE s2(p) ! { dg-error "Global name" }
INTERFACE
REAL FUNCTION p()
END
END INTERFACE
END
END INTERFACE
INTERFACE
REAL FUNCTION x()
END
END INTERFACE
INTERFACE
SUBROUTINE y
END
END INTERFACE
call g (x)
call g (y)
END
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment