Commit 9362a03b by Janus Weil

re PR fortran/56284 ([OOP] ICE with alternate return in type-bound procedure)

2013-04-03  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/56284
	PR fortran/40881
	* decl.c (gfc_match_formal_arglist): Warn about alternate-return
	arguments.
	* interface.c (check_dummy_characteristics): Return if symbols are NULL.

2013-04-03  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/56284
	PR fortran/40881
	* gfortran.dg/altreturn_8.f90: New.
	* gfortran.dg/altreturn_2.f90: Add -std=legacy.
	* gfortran.dg/intrinsic_actual_3.f90: Ditto.
	* gfortran.dg/invalid_interface_assignment.f90: Ditto.

From-SVN: r197389
parent e0f0935b
2013-04-03 Janus Weil <janus@gcc.gnu.org>
PR fortran/56284
PR fortran/40881
* decl.c (gfc_match_formal_arglist): Warn about alternate-return
arguments.
* interface.c (check_dummy_characteristics): Return if symbols are NULL.
2013-04-01 Janus Weil <janus@gcc.gnu.org>
PR fortran/56500
......
......@@ -4487,7 +4487,15 @@ gfc_match_formal_arglist (gfc_symbol *progname, int st_flag, int null_flag)
for (;;)
{
if (gfc_match_char ('*') == MATCH_YES)
sym = NULL;
{
sym = NULL;
if (gfc_notify_std (GFC_STD_F95_OBS, "Alternate-return argument "
"at %C") == FAILURE)
{
m = MATCH_ERROR;
goto cleanup;
}
}
else
{
m = gfc_match_name (name);
......
......@@ -1023,6 +1023,9 @@ static gfc_try
check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2,
bool type_must_agree, char *errmsg, int err_len)
{
if (s1 == NULL || s2 == NULL)
return s1 == s2 ? SUCCESS : FAILURE;
/* Check type and rank. */
if (type_must_agree && !compare_type_rank (s2, s1))
{
......
2013-04-03 Janus Weil <janus@gcc.gnu.org>
PR fortran/56284
PR fortran/40881
* gfortran.dg/altreturn_8.f90: New.
* gfortran.dg/altreturn_2.f90: Add -std=legacy.
* gfortran.dg/intrinsic_actual_3.f90: Ditto.
* gfortran.dg/invalid_interface_assignment.f90: Ditto.
2013-04-02 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/56745
......
! { dg-do compile }
! { dg-options "-std=gnu" }
program altreturn_2
call foo() ! { dg-error "Missing alternate return" }
contains
......
! { dg-do compile }
! { dg-options "-std=gnu" }
!
! PR 56284: [OOP] ICE with alternate return in type-bound procedure
!
! Contributed by Arjen Markus <arjen.markus@deltares.nl>
module try_this
implicit none
type :: table_t
contains
procedure, nopass :: getRecord
end type
contains
subroutine getRecord ( * )
end subroutine
end module
! { dg-final { cleanup-modules "try_this" } }
! { dg-do compile }
! { dg-options "-std=gnu" }
!
! Tests the fix for PR30237 in which alternate returns in intrinsic
! actual arglists were quietly ignored.
!
......
! { dg-do compile }
! { dg-options "-std=gnu" }
!
! Tests the fix for PR25102, which did not diagnose the aberrant interface
! assignement below.
!
......
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