Commit 96b95725 by Paul Thomas

re PR fortran/20847 (common block object may not have save attribute)

2005-10-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/20847
	PR fortran/20856
	* symbol.c (check_conflict): Prevent common variables and
	function results from having the SAVE attribute,as required
	by the standard.

2005-10-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/20847
	gfortran.dg/save_common.f90: New test.

	PR fortran/20856
	gfortran.dg/save_result.f90: New test.

From-SVN: r105325
parent 4def9c53
2005-10-12 Paul Thomas <pault@gcc.gnu.org>
PR fortran/20847
PR fortran/20856
* symbol.c (check_conflict): Prevent common variables and
function results from having the SAVE attribute,as required
by the standard.
2005-10-12 Paul Thomas <pault@gcc.gnu.org>
PR fortran/24207
* resolve.c (resolve_symbol): Exclude use and host associated
symbols from the test for private objects in a public namelist.
......
......@@ -322,6 +322,9 @@ check_conflict (symbol_attribute * attr, const char * name, locus * where)
conf (in_common, dummy);
conf (in_common, allocatable);
conf (in_common, result);
conf (in_common, save);
conf (result, save);
conf (dummy, result);
conf (in_equivalence, use_assoc);
......
2005-10-12 Paul Thomas <pault@gcc.gnu.org>
PR fortran/20847
gfortran.dg/save_common.f90: New test.
PR fortran/20856
gfortran.dg/save_result.f90: New test.
2005-10-12 Nathan Sidwell <nathan@codesourcery.com>
PR c++/21592
! { dg-do compile }
! PR20847 - A common variable may not have the SAVE attribute.
! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
INTEGER, SAVE :: X
COMMON /COM/ X ! { dg-error "conflicts with SAVE attribute" }
END
\ No newline at end of file
! { dg-do compile }
! PR20856 - A function result may not have SAVE attribute.
! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
FUNCTION X() RESULT(Y)
REAL, SAVE :: Y ! { dg-error "RESULT attribute conflicts with SAVE" }
y = 1
END FUNCTION X
END
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment