aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/decl.c3
-rw-r--r--gcc/fortran/expr.c3
-rw-r--r--gcc/fortran/resolve.c3
3 files changed, 7 insertions, 2 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)
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 188e796..4f456fc 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -6243,6 +6243,9 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
/* Variable not assignable from a PURE procedure but appears in
variable definition context. */
+ own_scope = own_scope
+ || (sym->attr.result && sym->ns->proc_name
+ && sym == sym->ns->proc_name->result);
if (!pointer && !own_scope && gfc_pure (NULL) && gfc_impure_variable (sym))
{
if (context)
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 "