[Bug fortran/41940] New: Improve error message for allocating scalar with shape

View: New views
3 Messages — Rating Filter:   Alert me  

[Bug fortran/41940] New: Improve error message for allocating scalar with shape

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

integer, allocatable :: a
allocate(a(4))
end

gives the - correct - error:

  Error: Syntax error in ALLOCATE statement at (1)

However, I prefer the error message of ifort:

  error #8196: An ALLOCATE shape must not be given for a scalar object.


--
           Summary: Improve error message for allocating scalar with shape
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


[Bug fortran/41940] Improve error message for allocating scalar with shape

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #1 from dfranke at gcc dot gnu dot org  2009-12-07 17:32 -------
Subject: Bug 41940

Author: dfranke
Date: Mon Dec  7 17:32:29 2009
New Revision: 155049

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155049
Log:
gcc/fortran:
2009-12-07  Daniel Franke  <franke.daniel@...>

        PR fortran/41940
        * match.c (gfc_match_allocate): Improved error message for
        allocatable scalars that are allocated with a shape.

gcc/testsuite:
2009-12-07  Daniel Franke  <franke.daniel@...>

        PR fortran/41940
        * gfortran.dg/allocate_scalar_with_shape.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/allocate_scalar_with_shape.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/match.c
    trunk/gcc/testsuite/ChangeLog


--


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


[Bug fortran/41940] Improve error message for allocating scalar with shape

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #2 from dfranke at gcc dot gnu dot org  2009-12-07 18:04 -------
Fixed in trunk. Closing.


--

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.5.0


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