+2006-11-22 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/29652
+ * interface.c (check_interface1): Use a local value, instead of
+ the dummy, as the inner iterator over interface symbols.
+
2006-11-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29820
here. */
static int
-check_interface1 (gfc_interface * p, gfc_interface * q,
+check_interface1 (gfc_interface * p, gfc_interface * q0,
int generic_flag, const char *interface_name)
{
-
+ gfc_interface * q;
for (; p; p = p->next)
- for (; q; q = q->next)
+ for (q = q0; q; q = q->next)
{
if (p->sym == q->sym)
continue; /* Duplicates OK here */
+2006-11-22 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/29652
+ * gfortran.dg/generic_7.f90: New test.
+ * gfortran.dg/defined_operators_1.f90: Add new error.
+
2006-11-22 Zdenek Dvorak <dvorakz@suse.cz>
PR tree-optimization/29902
module procedure foo_1 ! { dg-error "must be INTENT" }
module procedure foo_2 ! { dg-error "cannot be optional" }
module procedure foo_3 ! { dg-error "must have, at most, two arguments" }
- module procedure foo_1_OK
+ module procedure foo_1_OK ! { dg-error "Ambiguous interfaces" }
module procedure foo_2_OK
function foo_chr (chr) ! { dg-error "cannot be assumed character length" }
character(*) :: foo_chr
--- /dev/null
+! { dg-do compile }
+! Tests the fix for PR29652, in which ambiguous interfaces were not detected
+! with more than two specific procedures in the interface.
+!
+! Contributed by Daniel Franke <franke.daniel@gmail.com>
+!
+MODULE global
+INTERFACE iface
+ MODULE PROCEDURE sub_a
+ MODULE PROCEDURE sub_b ! { dg-error "Ambiguous interfaces" }
+ MODULE PROCEDURE sub_c
+END INTERFACE
+CONTAINS
+ SUBROUTINE sub_a(x)
+ INTEGER, INTENT(in) :: x
+ WRITE (*,*) 'A: ', x
+ END SUBROUTINE
+ SUBROUTINE sub_b(y)
+ INTEGER, INTENT(in) :: y
+ WRITE (*,*) 'B: ', y
+ END SUBROUTINE
+ SUBROUTINE sub_c(x, y)
+ REAL, INTENT(in) :: x, y
+ WRITE(*,*) x, y
+ END SUBROUTINE
+END MODULE
+! { dg-final { cleanup-modules "global" } }