[patch, fortran] PRs 31818, 32876, 32905 - about namelists

Daniel Franke franke.daniel@gmail.com
Fri Jul 27 22:04:00 GMT 2007


To track pointer and private components in nested derived types (PR32876,, 
PR32905), two new bits were introduced in symbol_attribute: pointer_comp and 
private_comp. They are used analogously to alloc_comp - they are set if any 
component of a (nested) type is a pointer or has restricted access, 
respectively.

PR31818 was fixed by moving the test for assumed shape arrays from match.c 
(gfc_match_namelist) to resolve.c (resolve_fl_namelist) as as->type is not 
yet available in gfc_match_namelist() if no bound is specified, i.e.

  character(len=10) :: cha(1:)
  namelist /z/  cha               ! error, assumed shape

while

  character(len=10) :: cha(:)
  namelist /z/  cha

passed unnoticed. As assumed shape arrays already were accepted as an GNU 
extension and F2003 allows them officially, assumed shape arrays are now 
rejected only if -std=f95. The testcase namelist_31.f90 used this extension 
already, while namelist_35.f90 now sets the standard and checks for an error.


:ADDPATCH fortran:

gcc/fortran:
2007-07-28  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/31818
	PR fortran/32876
	PR fortran/32905
	* gfortran.h (symbol_attribute): Added bits for pointer_comp, private_comp.
	* parse.c (parse_derived): Set pointer_comp/private_comp bits if the derived
	type ultimately contains pointer components or private components.
	* module.c (ab_attribute): New values AB_POINTER_COMP, AB_PRIVATE_COMP.
	(attr_bits): Added names for new ab_attributes.
	(mio_symbol_attribute): Save/restore new attribute bits in modules.
	* match.c (gfc_match_namelist): Removed check for namelist objects of assumed
	shape.
	* resolve.c (resolve_fl_namelist): Added check for pointer or private
	components in nested types. Added check for namelist objects of assumed
	shape.

gcc/testsuite:
2007-07-28  Daniel Franke  <franke.daniel@gmail.com>

	* gfortran.dg/namelist_5.f90: Adjusted error message.

	* gfortran.dg/assumed_shape_nml.f90: Renamed to ...
	* gfortran.dg/namelist_31.f90: ... this. Removed dg-warning directive.
	* gfortran.dg/assumed_size_nml.f90: Renamed to ...
	* gfortran.dg/namelist_32.f90: ... this.

	PR fortran/32876
	* gfortran.dg/namelist_33.f90: New test.
	
	PR fortran/32905
	* gfortran.dg/namelist_34.f90: New test.

	PR fortran/31818
	* gfortran.dg/namelist_35.f90: New test.


Regression tested on i686-pc-linux-gnu, currently bootstrapping. 
Ok for trunk if successfull?

Regards
	Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: namelist.patch
Type: text/x-diff
Size: 12408 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070727/364fdbcb/attachment.bin>


More information about the Fortran mailing list