decl.c (match_old_style_init): Add data attribute to symbol.
* decl.c (match_old_style_init): Add data attribute to symbol. * gfortran.dg/oldstyle_2.f90: New. From-SVN: r115161
This commit is contained in:
parent
11fc427598
commit
ed0e3607b2
@ -1,3 +1,7 @@
|
||||
2006-07-03 Asher Langton <langton2@llnl.gov>
|
||||
|
||||
* decl.c (match_old_style_init): Add data attribute to symbol.
|
||||
|
||||
2006-07-03 Francois-Xavier Coudert <coudert@clipper.ens.fr>
|
||||
|
||||
* iresolve.c (gfc_resolve_cpu_time, gfc_resolve_random_number):
|
||||
|
@ -385,10 +385,12 @@ match_old_style_init (const char *name)
|
||||
{
|
||||
match m;
|
||||
gfc_symtree *st;
|
||||
gfc_symbol *sym;
|
||||
gfc_data *newdata;
|
||||
|
||||
/* Set up data structure to hold initializers. */
|
||||
gfc_find_sym_tree (name, NULL, 0, &st);
|
||||
sym = st->n.sym;
|
||||
|
||||
newdata = gfc_get_data ();
|
||||
newdata->var = gfc_get_data_variable ();
|
||||
@ -410,6 +412,13 @@ match_old_style_init (const char *name)
|
||||
return MATCH_ERROR;
|
||||
}
|
||||
|
||||
/* Mark the variable as having appeared in a data statement. */
|
||||
if (gfc_add_data (&sym->attr, sym->name, &sym->declared_at) == FAILURE)
|
||||
{
|
||||
gfc_free (newdata);
|
||||
return MATCH_ERROR;
|
||||
}
|
||||
|
||||
/* Chain in namespace list of DATA initializers. */
|
||||
newdata->next = gfc_current_ns->data;
|
||||
gfc_current_ns->data = newdata;
|
||||
|
@ -1,3 +1,7 @@
|
||||
2006-07-03 Asher Langton <langton2@llnl.gov>
|
||||
|
||||
* gfortran.dg/oldstyle_2.f90: New.
|
||||
|
||||
2006-07-03 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* gnat.dg/gnat.dg/string_slice.adb: New test.
|
||||
|
4
gcc/testsuite/gfortran.dg/oldstyle_2.f90
Normal file
4
gcc/testsuite/gfortran.dg/oldstyle_2.f90
Normal file
@ -0,0 +1,4 @@
|
||||
! { dg-do compile}
|
||||
subroutine foo(i) ! { dg-error "DATA attribute" }
|
||||
integer i /10/
|
||||
end subroutine foo
|
Loading…
Reference in New Issue
Block a user