This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran] PR43169: [OOP] gfortran rejects pure procedure with select type construct
- From: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- To: Dominique Dhumieres <dominiq at lps dot ens dot fr>
- Cc: fortran at gcc dot gnu dot org, janus at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 2 Mar 2010 22:56:13 +0100
- Subject: Re: [Patch, Fortran] PR43169: [OOP] gfortran rejects pure procedure with select type construct
- References: <20100302143019.52AB13BE0F@mailhost.lps.ens.fr>
Dear Janus,
The patch is fine apart from one bit; that in resolve_code.
The bit that resets gfc_current_ns
@@ -8165,6 +8169,7 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
case EXEC_SELECT_TYPE:
resolve_select_type (code);
+ gfc_current_ns = ns;
break;
is better put as
@@ -8012,6 +8012,11 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
case EXEC_OMP_DO:
gfc_resolve_omp_do_blocks (code, ns);
break;
+ case EXEC_SELECT_TYPE:
+ gfc_current_ns = code->ext.ns;
+ gfc_resolve_blocks (code->block, gfc_current_ns);
+ gfc_current_ns = ns;
+ break;
case EXEC_OMP_WORKSHARE:
omp_workshare_save = omp_workshare_flag;
omp_workshare_flag = 1;
unless I have missed something. Certainly it works fine. If I am
wrong, could you please comment the first block to indicate where the
reset occurs and why.
Apart from this, it is OK for trunk.
Thanks
Paul