This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]