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:
parent
a5c655e832
commit
242633d6ea
@ -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
|
||||
|
@ -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. */
|
||||
|
@ -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
|
||||
|
19
gcc/testsuite/gfortran.dg/elemental_args_check_2.f90
Normal file
19
gcc/testsuite/gfortran.dg/elemental_args_check_2.f90
Normal 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
|
Loading…
Reference in New Issue
Block a user