+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
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);
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
--- /dev/null
+! { dg-do compile }\r
+! { dg-options "-std=gnu" }\r
+!\r
+! PR 56284: [OOP] ICE with alternate return in type-bound procedure\r
+!\r
+! Contributed by Arjen Markus <arjen.markus@deltares.nl>\r
+\r
+module try_this\r
+ implicit none\r
+\r
+ type :: table_t\r
+ contains\r
+ procedure, nopass :: getRecord\r
+ end type\r
+\r
+contains\r
+\r
+ subroutine getRecord ( * )\r
+ end subroutine\r
+\r
+end module\r
+\r
+! { dg-final { cleanup-modules "try_this" } }\r
! { 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.
!