PR fortran/34514
* decl.c (attr_decl1): Reject specifying the DIMENSION for
already initialized variable.
(do_parm): Reject PARAMETER for already initialized variable.
2007-12-25 Tobias Burnus <burnus@net-b.de>
PR fortran/34514
* gfortran.dg/initialization_17.f90: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131169
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-12-25 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/34514
+ * decl.c (attr_decl1): Reject specifying the DIMENSION for
+ already initialized variable.
+ (do_parm): Reject PARAMETER for already initialized variable.
+
2007-12-25 Daniel Franke <franke.daniel@gmail.com>
PR fortran/34533
goto cleanup;
}
+ if (current_attr.dimension && sym->value)
+ {
+ gfc_error ("Dimensions specified for %s at %L after its "
+ "initialisation", sym->name, &var_locus);
+ m = MATCH_ERROR;
+ goto cleanup;
+ }
+
if ((current_attr.allocatable || current_attr.pointer)
&& (m == MATCH_YES) && (as->type != AS_DEFERRED))
{
goto cleanup;
}
+ if (sym->value)
+ {
+ gfc_error ("Initializing already initialized variable at %C");
+ m = MATCH_ERROR;
+ goto cleanup;
+ }
+
if (sym->ts.type == BT_CHARACTER
&& sym->ts.cl != NULL
&& sym->ts.cl->length != NULL
+2007-12-25 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/34514
+ * gfortran.dg/initialization_17.f90: New.
+
2007-12-25 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/34566
--- /dev/null
+! { dg-do compile }
+!
+! PR fortran/34514
+!
+! Initialization and typespec changes.
+!
+integer :: n = 5, m = 7
+parameter (n = 42) ! { dg-error "Initializing already initialized variable" }
+dimension :: m(3) ! { dg-error "after its initialisation" }
+end