mirror of git://gcc.gnu.org/git/gcc.git
re PR fortran/41940 (Improve error message for allocating scalar with shape)
gcc/fortran: 2009-12-07 Daniel Franke <franke.daniel@gmail.com> 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@gmail.com> PR fortran/41940 * gfortran.dg/allocate_scalar_with_shape.f90: New. From-SVN: r155049
This commit is contained in:
parent
b3a00b5034
commit
d59b1dcb19
|
@ -1,3 +1,9 @@
|
|||
2009-12-07 Daniel Franke <franke.daniel@gmail.com>
|
||||
|
||||
PR fortran/41940
|
||||
* match.c (gfc_match_allocate): Improved error message for
|
||||
allocatable scalars that are allocated with a shape.
|
||||
|
||||
2009-12-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
PR other/40302
|
||||
|
|
|
@ -2502,6 +2502,12 @@ gfc_match_allocate (void)
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
if (gfc_peek_ascii_char () == '(' && !sym->attr.dimension)
|
||||
{
|
||||
gfc_error ("Shape specification for allocatable scalar at %C");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (gfc_match_char (',') != MATCH_YES)
|
||||
break;
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2009-12-07 Daniel Franke <franke.daniel@gmail.com>
|
||||
|
||||
PR fortran/41940
|
||||
* gfortran.dg/allocate_scalar_with_shape.f90: New.
|
||||
|
||||
2009-12-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
PR other/40302
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
! { dg-do "compile" }
|
||||
! PR fortran/41940
|
||||
|
||||
integer, allocatable :: a
|
||||
TYPE :: x
|
||||
integer, allocatable :: a
|
||||
END TYPE
|
||||
TYPE (x) :: y
|
||||
|
||||
allocate(a(4)) ! { dg-error "Shape specification for allocatable scalar" }
|
||||
allocate(y%a(4)) ! { dg-error "Shape specification for allocatable scalar" }
|
||||
end
|
||||
|
Loading…
Reference in New Issue