[Patch, Fortran] PR43169: [OOP] gfortran rejects pure procedure with select type construct

Paul Richard Thomas paul.richard.thomas@gmail.com
Tue Mar 2 21:56:00 GMT 2010


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



More information about the Fortran mailing list