aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2021-01-21 10:00:00 +0000
committerPaul Thomas <pault@gcc.gnu.org>2021-01-21 10:00:49 +0000
commiteaf883710c0039eca5caea5115e848adb4ab67bd (patch)
treefc7baa465ca84ce19178b9c6657ed0932ea636fb /gcc/fortran/decl.c
parentf46a40112caa7e039d949beda94386ff4e436a35 (diff)
downloadgcc-eaf883710c0039eca5caea5115e848adb4ab67bd.zip
gcc-eaf883710c0039eca5caea5115e848adb4ab67bd.tar.gz
gcc-eaf883710c0039eca5caea5115e848adb4ab67bd.tar.bz2
Fortran: This patch fixes comments 23 and 24 of PR96320.
2021-01-21 Paul Thomas <pault@gcc.gnu.org> 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.
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 4771b59..7239158 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -9856,7 +9856,8 @@ gfc_match_modproc (void)
gfc_namespace *module_ns;
gfc_interface *old_interface_head, *interface;
- if (gfc_state_stack->state != COMP_INTERFACE
+ if ((gfc_state_stack->state != COMP_INTERFACE
+ && gfc_state_stack->state != COMP_CONTAINS)
|| gfc_state_stack->previous == NULL
|| current_interface.type == INTERFACE_NAMELESS
|| current_interface.type == INTERFACE_ABSTRACT)