Output an error for ambiguous interfaces in generic interface
instead of ICE.
2020-07-02 Steven G. Kargl <kargl@gcc.gnu.org>
gcc/fortran/
PR fortran/95584
* interface.c (generic_correspondence): Only use the pointer
to a symbol if exists.
2020-07-02 Mark Eggleston <markeggleston@gcc.gnu.org>
gcc/testsuite/
PR fortran/95584
* gfortran.dg/pr95584.f90: New test.
while (f1)
{
- if (f1->sym->attr.optional)
+ if (!f1->sym || f1->sym->attr.optional)
goto next;
if (p1 && strcmp (f1->sym->name, p1) == 0)
--- /dev/null
+! { dg-do compile }
+
+program p
+ interface s
+ subroutine g(x, *)
+ end
+ subroutine h(y, *)
+ end
+ end interface
+end
+
+! { dg-warning "Obsolescent feature: Alternate-return argument" " " { target *-*-* } 5 }
+! { dg-warning "Obsolescent feature: Alternate-return argument" " " { target *-*-* } 7 }
+! { dg-error ".1." " " { target *-*-* } 5 }
+! { dg-error "Ambiguous interfaces in generic interface" " " { target *-*-* } 7 }
+