re PR fortran/34660 (elemental and dummy procedure)

2008-01-06  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34660
        * resolve.c (resolve_formal_arglist): Reject dummy procedure in
        ELEMENTAL functions.

2008-01-06  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34660
        * gfortran.dg/elemental_args_check_2.f90: New.

From-SVN: r131349
This commit is contained in:
Tobias Burnus 2008-01-06 10:18:43 +01:00 committed by Tobias Burnus
parent a5c655e832
commit 242633d6ea
4 changed files with 38 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2008-01-06 Tobias Burnus <burnus@net-b.de>
PR fortran/34660
* resolve.c (resolve_formal_arglist): Reject dummy procedure in
ELEMENTAL functions.
2008-01-06 Tobias Burnus <burnus@net-b.de>
PR fortran/34662

View File

@ -225,6 +225,14 @@ resolve_formal_arglist (gfc_symbol *proc)
&sym->declared_at);
continue;
}
if (sym->attr.flavor == FL_PROCEDURE)
{
gfc_error ("Dummy procedure '%s' not allowed in elemental "
"procedure '%s' at %L", sym->name, proc->name,
&sym->declared_at);
continue;
}
}
/* Each dummy shall be specified to be scalar. */

View File

@ -1,3 +1,8 @@
2008-01-06 Tobias Burnus <burnus@net-b.de>
PR fortran/34660
* gfortran.dg/elemental_args_check_2.f90: New.
2008-01-06 Tobias Burnus <burnus@net-b.de>
PR fortran/34662

View File

@ -0,0 +1,19 @@
! { dg-do compile }
!
! PR fortran/34660
!
! Check for elemental constrain C1277 (F2003).
! Contributed by Joost VandeVondele.
!
MODULE M1
IMPLICIT NONE
CONTAINS
PURE ELEMENTAL SUBROUTINE S1(I,F)
INTEGER, INTENT(IN) :: I
INTERFACE
PURE INTEGER FUNCTION F(I) ! { dg-error "Dummy procedure 'f' not allowed in elemental procedure" }
INTEGER, INTENT(IN) :: I
END FUNCTION F
END INTERFACE
END SUBROUTINE S1
END MODULE M1