Commit 25ffd46f by Tobias Burnus Committed by Tobias Burnus

re PR fortran/55638 (Wrongly accepts INTENT + VALUE - and wrongly requires it for PURE)

2012-12-16  Tobias Burnus  <burnus@net-b.de>

        PR fortran/55638
        * resolve.c (resolve_formal_arglist): Allow VALUE without
        INTENT for ELEMENTAL procedures.

2012-12-16  Tobias Burnus  <burnus@net-b.de>

        PR fortran/55638
        * gfortran.dg/elemental_args_check_3.f90: Update dg-error.
        * gfortran.dg/elemental_args_check_7.f90: New.

From-SVN: r194525
parent 25293279
2012-12-16 Tobias Burnus <burnus@net-b.de>
PR fortran/55638
* resolve.c (resolve_formal_arglist): Allow VALUE without
INTENT for ELEMENTAL procedures.
2012-12-10 Janus Weil <janus@gcc.gnu.org> 2012-12-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/52909 PR fortran/52909
...@@ -5,8 +11,8 @@ ...@@ -5,8 +11,8 @@
2012-12-09 Tobias Burnus <burnus@net-b.de> 2012-12-09 Tobias Burnus <burnus@net-b.de>
* trans-array.c (gfc_deallocate_scalar_with_status): Use * trans-array.c (structure_alloc_comps): Use NULL_TREE in the
NULL_TREE in the call to gfc_deallocate_scalar_with_status. call to gfc_deallocate_scalar_with_status.
* trans-decl.c (gfc_trans_deferred_vars): Pass symbol. * trans-decl.c (gfc_trans_deferred_vars): Pass symbol.
* trans-stmt.c (gfc_trans_deallocate): Pass polymorphic variable. * trans-stmt.c (gfc_trans_deallocate): Pass polymorphic variable.
......
...@@ -488,10 +488,12 @@ resolve_formal_arglist (gfc_symbol *proc) ...@@ -488,10 +488,12 @@ resolve_formal_arglist (gfc_symbol *proc)
continue; continue;
} }
if (sym->attr.intent == INTENT_UNKNOWN) /* Fortran 2008 Corrigendum 1, C1290a. */
if (sym->attr.intent == INTENT_UNKNOWN && !sym->attr.value)
{ {
gfc_error ("Argument '%s' of elemental procedure '%s' at %L must " gfc_error ("Argument '%s' of elemental procedure '%s' at %L must "
"have its INTENT specified", sym->name, proc->name, "have its INTENT specified or have the VALUE "
"attribute", sym->name, proc->name,
&sym->declared_at); &sym->declared_at);
continue; continue;
} }
......
2012-12-16 Tobias Burnus <burnus@net-b.de>
PR fortran/55638
* gfortran.dg/elemental_args_check_3.f90: Update dg-error.
* gfortran.dg/elemental_args_check_7.f90: New.
2012-12-15 Eric Botcazou <ebotcazou@adacore.com> 2012-12-15 Eric Botcazou <ebotcazou@adacore.com>
* lib/scanasm.exp (get_ada_spec_filename): Use procedural form. * lib/scanasm.exp (get_ada_spec_filename): Use procedural form.
......
...@@ -13,7 +13,7 @@ CONTAINS ...@@ -13,7 +13,7 @@ CONTAINS
(a, & ! { dg-error "must be scalar" } (a, & ! { dg-error "must be scalar" }
b, & ! { dg-error "POINTER attribute" } b, & ! { dg-error "POINTER attribute" }
c, & ! { dg-error "ALLOCATABLE attribute" } c, & ! { dg-error "ALLOCATABLE attribute" }
d) ! { dg-error "INTENT specified" } d) ! { dg-error "must have its INTENT specified or have the VALUE attribute" }
INTEGER, INTENT(IN) :: a(:) INTEGER, INTENT(IN) :: a(:)
INTEGER, POINTER, INTENT(IN) :: b INTEGER, POINTER, INTENT(IN) :: b
INTEGER, ALLOCATABLE, INTENT(IN) :: c INTEGER, ALLOCATABLE, INTENT(IN) :: c
......
! { dg-do compile }
!
! PR fortran/55638
!
! Additionally, VALUE no INTENT is required (and only "intent(in)" allowed)
!
elemental subroutine foo(x, y, z)
integer, intent(inout) :: x
integer, VALUE :: y
integer, VALUE, intent(in) :: z
x = y
end subroutine foo
impure elemental subroutine foo2(x, y, z) ! { dg-error "Argument 'x' of elemental procedure 'foo2' at .1. must have its INTENT specified or have the VALUE attribute" }
integer :: x
integer, VALUE :: y
integer, VALUE :: z
x = y
end subroutine foo2
subroutine foo3(x, y, z)
integer, VALUE, intent(in) :: x
integer, VALUE, intent(inout) :: y ! { dg-error "VALUE attribute conflicts with INTENT.INOUT. attribute" }
integer, VALUE, intent(out) :: z ! { dg-error "VALUE attribute conflicts with INTENT.OUT. attribute" }
end subroutine foo3
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