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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155049
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
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;
+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
--- /dev/null
+! { 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
+