This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch, fortran] PR30878 - Rejects function f1; namelist /nml/ f1
- From: "Paul Richard Thomas" <paul dot richard dot thomas at gmail dot com>
- To: "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>, "gcc-patches List" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 9 May 2007 09:49:59 +0200
- Subject: [Patch, fortran] PR30878 - Rejects function f1; namelist /nml/ f1
:ADDPATCH fortran:
This PR comes about because gfortran throws an error upon an implicit
result variable appearing in a namelist. The patch consists of two
steps: (i) Prevent the emission of the compilation error in symbol.c
and resolve.c; and (ii) Add the requisite code to trans-io.c. The
comments and the ChangeLogs are sufficiently descriptive to follow
what is going on. The testcase is a mutilation of the reporter's.
Bootstrapped and regtested on x86_ia64 - OK for trunk?
Paul
PS At the time of my first contribution to gfortran, the testsuite
contain two testcases for NAMELIST. There are now 33 of the
blighters. Please accept my apologies:)
2007-05-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30878
* resolve.c (resolve_fl_namelist): It is not an error if the
namelist element is the result variable of the enclosing
function. Search for the symbol in current and all parent
namespaces for a potential conflict.
* symbol.c (check_conflict): Remove the conflict between
'in_namelist' and 'FL_PROCEDURE' because the symbol info
is not available to exclude function result variables.
* trans-io.c (nml_get_addr_expr): Use the fake result decl
if the symbol is an implicit result variable.
2007-05-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30878
* gfortran.dg/namelist_29.f90: New test.