This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, Fortran, F03] PR 58916: Allocation of scalar with array source not rejected


Hi all,

attached is a small patch which fixes accepts-invalid and
ICE-on-invalid problems on allocation with source. Regtested on
x86_64-unknown-linux-gnu. Ok for trunk?

Cheers,
Janus


2013-12-11  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/58916
    * resolve.c (conformable_arrays): Treat scalar 'e2'.
    (resolve_allocate_expr): Check rank also for unlimited-polymorphic
    variables.


2013-12-11  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/58916
    * gfortran.dg/allocate_with_source_4.f90: New.

Attachment: pr58916.diff
Description: Text document

! { dg-do compile }
!
! PR 58916: [F03] Allocation of scalar with array source not rejected
!
! Contributed by Vladimir Fuka <vladimir.fuka@gmail.com>

  class(*), allocatable :: a1
  real, allocatable :: a2  
  real b(1)
  allocate(a1, source=b)  ! { dg-error "must be scalar or have the same rank" }
  allocate(a2, source=b)  ! { dg-error "must be scalar or have the same rank" }
end

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]