-017-02-19 Paul Thomas <pault@gcc.gnu.org>
+2017-02-19 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/79447
+ * decl.c (gfc_set_constant_character_len): Whitespace.
+ (gfc_match_end): Catch case where a procedure is contained in
+ a module procedure and ensure that 'end procedure' is the
+ correct termination.
+
+2017-02-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/79402
* resolve.c (fixup_unique_dummy): New function.
if (expr->ts.type != BT_CHARACTER)
return;
-
+
if (expr->expr_type != EXPR_CONSTANT)
{
gfc_error_now ("CHARACTER length must be a constant at %L", &expr->where);
match m;
gfc_namespace *parent_ns, *ns, *prev_ns;
gfc_namespace **nsp;
- bool abreviated_modproc_decl;
+ bool abreviated_modproc_decl = false;
bool got_matching_end = false;
old_loc = gfc_current_locus;
state = gfc_state_stack->previous->state;
block_name = gfc_state_stack->previous->sym == NULL
? NULL : gfc_state_stack->previous->sym->name;
+ abreviated_modproc_decl = gfc_state_stack->previous->sym
+ && gfc_state_stack->previous->sym->abr_modproc_decl;
break;
default:
break;
}
- abreviated_modproc_decl
- = gfc_current_block ()
- && gfc_current_block ()->abr_modproc_decl;
+ if (!abreviated_modproc_decl)
+ abreviated_modproc_decl = gfc_current_block ()
+ && gfc_current_block ()->abr_modproc_decl;
switch (state)
{
--- /dev/null
+! { dg-do compile }
+! Test the fix for PR79447, in which the END PROCEDURE statement
+! for MODULE PROCEDURE foo was not accepted.
+!
+! Contributed by Damian Rouson <damian@sourceryinstitute.org>
+!
+module foo_interface
+ implicit none
+ interface
+ module subroutine foo()
+ end subroutine
+ end interface
+end module foo_interface
+
+submodule(foo_interface) foo_implementation
+contains
+ module procedure foo
+ contains
+ module subroutine bar()
+ end subroutine
+ end procedure
+ !end subroutine ! gfortran accepted this invalid workaround
+end submodule