The ALLOCATABLE attribute was only allowed for arrays in F95, but F03 also
allows allocatable scalars (which will be useful for polymorphism).

Simple example:

real, allocatable :: scalar
allocate(scalar)
scalar = exp(1.)
print *,scalar
deallocate(scalar)
end


With current trunk you get:

as.f90:1.27:

real, allocatable :: scalar
                           1
Error: Scalar object 'scalar' at (1) may not be ALLOCATABLE
as.f90:2.9:

allocate(scalar)
         1
Error: Array specification required in ALLOCATE statement at (1)


-- 
           Summary: [F03] ALLOCATABLE scalars
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: janus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40996

Reply via email to