re PR fortran/35837 (rej.valid: Host-associated SAVEd variable and PURE function)

2008-09-05  Daniel Kraft  <d@domob.eu>

	PR fortran/35837
	* resolve.c (resolve_types): Restore gfc_current_ns on exit.
	* symbol.c (gfc_save_all): Removed blank line.

2008-09-05  Daniel Kraft  <d@domob.eu>

	PR fortran/35837
	* gfortran.dg/save_3.f90: New test.

From-SVN: r140046
This commit is contained in:
Daniel Kraft 2008-09-05 22:51:50 +02:00 committed by Daniel Kraft
parent 5ffebee7bb
commit a82f1f2efa
5 changed files with 32 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2008-09-05 Daniel Kraft <d@domob.eu>
PR fortran/35837
* resolve.c (resolve_types): Restore gfc_current_ns on exit.
* symbol.c (gfc_save_all): Removed blank line.
2008-09-05 Daniel Kraft <d@domob.eu>
PR fortran/36746

View File

@ -10116,8 +10116,7 @@ resolve_types (gfc_namespace *ns)
gfc_charlen *cl;
gfc_data *d;
gfc_equiv *eq;
gfc_current_ns = ns;
gfc_namespace* old_ns = gfc_current_ns;
/* Check that all IMPLICIT types are ok. */
if (!ns->seen_implicit_none)
@ -10131,6 +10130,8 @@ resolve_types (gfc_namespace *ns)
return;
}
gfc_current_ns = ns;
resolve_entries (ns);
resolve_common_vars (ns->blank_common.head, false);
@ -10185,6 +10186,8 @@ resolve_types (gfc_namespace *ns)
warn_unused_fortran_label (ns->st_labels);
gfc_resolve_uops (ns->uop_root);
gfc_current_ns = old_ns;
}

View File

@ -3194,7 +3194,6 @@ save_symbol (gfc_symbol *sym)
void
gfc_save_all (gfc_namespace *ns)
{
gfc_traverse_ns (ns, save_symbol);
}

View File

@ -1,3 +1,8 @@
2008-09-05 Daniel Kraft <d@domob.eu>
PR fortran/35837
* gfortran.dg/save_3.f90: New test.
2008-09-05 Douglas Gregor <doug.gregor@gmail.com>
PR c++/37342

View File

@ -0,0 +1,16 @@
! { dg-do compile }
! PR fortran/35837
! We used do have a problem with resolving "save all" and nested namespaces.
! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
module g95bug
save
integer :: i=20
contains
pure function tell_i() result (answer)
integer :: answer
answer=i
end function tell_i
end module g95bug