Commit 81ea7c11 by Steven G. Kargl

re PR fortran/65453 (ICE in build_function_decl, at fortran/trans-decl.c:2001)

2018-03-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/65453
	* decl.c (get_proc_name): Catch clash between a procedure statement
	and a contained subprogram

2018-03-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/65453
	* gfortran.dg/pr65453.f90: New test.

From-SVN: r258632
parent 928b965f
2018-03-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/65453
* decl.c (get_proc_name): Catch clash between a procedure statement
and a contained subprogram
2018-03-16 Steven G. Kargl <kargl@gcc.gnu.org> 2018-03-16 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/69395 PR fortran/69395
......
...@@ -1219,6 +1219,12 @@ get_proc_name (const char *name, gfc_symbol **result, bool module_fcn_entry) ...@@ -1219,6 +1219,12 @@ get_proc_name (const char *name, gfc_symbol **result, bool module_fcn_entry)
gfc_error_now ("Procedure %qs at %C is already defined at %L", gfc_error_now ("Procedure %qs at %C is already defined at %L",
name, &sym->declared_at); name, &sym->declared_at);
if (sym->attr.external && sym->attr.procedure
&& gfc_current_state () == COMP_CONTAINS)
gfc_error_now ("Contained procedure %qs at %C clashes with "
"procedure defined at %L",
name, &sym->declared_at);
/* Trap a procedure with a name the same as interface in the /* Trap a procedure with a name the same as interface in the
encompassing scope. */ encompassing scope. */
if (sym->attr.generic != 0 if (sym->attr.generic != 0
......
2018-03-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/65453
* gfortran.dg/pr65453.f90: New test.
2018-03-18 Richard Sandiford <richard.sandiford@linaro.org> 2018-03-18 Richard Sandiford <richard.sandiford@linaro.org>
PR tree-optimization/84913 PR tree-optimization/84913
......
! { dg-do compile }
! PR fortran/65453
! Contributed by Tobias Burnus <burnus at gcc.gnu.org>
procedure() :: foo ! { dg-error "(1)" }
contains
subroutine foo() ! { dg-error "clashes with procedure" }
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment