PR fortran/33917
* interface.c (check_sym_interfaces): Disallow PROCEDURE-declared
procedures for MODULE PROCEDURE.
* decl.c (match_procedure_in_interface): Do not mark as procedure.
2007-11-08 Tobias Burnus <burnus@net-b.de>
PR fortran/33917
* gfortran.dg/proc_decl_5.f90: New.
* gfortran.dg/proc_decl_6.f90: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130002
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-11-08 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/33917
+ * interface.c (check_sym_interfaces): Disallow PROCEDURE-declared
+ procedures for MODULE PROCEDURE.
+ * decl.c (match_procedure_in_interface): Do not mark as procedure.
+
2007-11-03 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33881
if (gfc_add_interface (sym) == FAILURE)
return MATCH_ERROR;
- sym->attr.procedure = 1;
-
if (gfc_match_eos () == MATCH_YES)
break;
if (gfc_match_char (',') != MATCH_YES)
for (p = sym->generic; p; p = p->next)
{
- if (p->sym->attr.mod_proc && p->sym->attr.if_source != IFSRC_DECL)
+ if (p->sym->attr.mod_proc
+ && (p->sym->attr.if_source != IFSRC_DECL
+ || p->sym->attr.procedure))
{
gfc_error ("'%s' at %L is not a module procedure",
p->sym->name, &p->where);
+2007-11-08 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/33917
+ * gfortran.dg/proc_decl_5.f90: New.
+ * gfortran.dg/proc_decl_6.f90: New.
+
2007-11-08 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/32575
--- /dev/null
+! { dg-do run }
+! PR fortran/33945
+!
+! PROCEDURE in the interface was wrongly rejected
+module modproc
+ implicit none
+ interface bar
+ procedure x
+ end interface bar
+ procedure(sub) :: x
+ interface
+ integer function sub()
+ end function sub
+ end interface
+end module modproc
+
+integer function x()
+ implicit none
+ x = -5
+end function x
+
+program test
+ use modproc
+ implicit none
+ if(x() /= -5) call abort()
+end program test
+
+! { dg-final { cleanup-modules "modproc" } }
--- /dev/null
+! { dg-do compile }
+! PR fortran/33945
+!
+! MODULE PROCEDURE in the interface was wrongly accepted
+module modproc2
+ implicit none
+ interface
+ subroutine x
+ end subroutine x
+ end interface
+ procedure(x) :: y
+ interface bar
+ module procedure y ! { dg-error "not a module procedure" }
+ end interface bar
+end module modproc2
+
+end