From eaf883710c0039eca5caea5115e848adb4ab67bd Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Thu, 21 Jan 2021 10:00:00 +0000 Subject: Fortran: This patch fixes comments 23 and 24 of PR96320. 2021-01-21 Paul Thomas gcc/fortran PR fortran/96320 * decl.c (gfc_match_modproc): It is not an error to find a module procedure declaration within a contains block. * expr.c (gfc_check_vardef_context): Pure procedure result is assignable. Change 'own_scope' accordingly. * resolve.c (resolve_typebound_procedure): A procedure that has the module procedure attribute is almost certainly a module procedure, whatever its interface. gcc/testsuite/ PR fortran/96320 * gfortran.dg/module_procedure_5.f90 : New test. * gfortran.dg/module_procedure_6.f90 : New test. --- gcc/fortran/resolve.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/resolve.c') diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index bb069ef..c075d0f 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -14025,7 +14025,8 @@ resolve_typebound_procedure (gfc_symtree* stree) /* Check for F08:C465. */ if ((!proc->attr.subroutine && !proc->attr.function) || (proc->attr.proc != PROC_MODULE - && proc->attr.if_source != IFSRC_IFBODY) + && proc->attr.if_source != IFSRC_IFBODY + && !proc->attr.module_procedure) || proc->attr.abstract) { gfc_error ("%qs must be a module procedure or an external " -- cgit v1.1