procedure interface body. */
if (sym->attr.is_bind_c && sym->attr.module_procedure && sym->old_symbol
&& strcmp (sym->name, sym->old_symbol->name) == 0
+ && sym->binding_label && sym->old_symbol->binding_label
&& strcmp (sym->binding_label, sym->old_symbol->binding_label) != 0)
{
const char *null = "NULL", *s1, *s2;
procedure interface body. */
if (sym->attr.module_procedure && sym->old_symbol
&& strcmp (sym->name, sym->old_symbol->name) == 0
+ && sym->binding_label && sym->old_symbol->binding_label
&& strcmp (sym->binding_label, sym->old_symbol->binding_label) != 0)
{
const char *null = "NULL", *s1, *s2;
--- /dev/null
+! { dg-do compile }
+! PR fortran/95342 - ICE in gfc_match_subroutine, at fortran/decl.c:7913
+
+module m1
+ interface
+ module subroutine s()
+ end
+ subroutine s() bind(c) ! { dg-error "EXTERNAL attribute conflicts" }
+ end ! { dg-error "END INTERFACE" }
+ end interface
+end
+
+module m2
+ interface
+ module function f()
+ end
+ function f() bind(c)
+ end ! { dg-error "Duplicate EXTERNAL attribute" }
+ end interface
+end