This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

[patch, fortran] PR29876 - ICE on bad operator


Simple fix, testcase is the reporter's.


:ADDPATCH fortran:

2007-07-07  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/29876
	* module.c (gfc_match_use): Do not set an non-existant 
	intrinsic operator if a user-defined operator is found.


2007-07-07  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/29876
	* gfortran.dg/operator_6.f90: New test.


Regression tested on i686-pc-linux-gnu. Ok for trunk?

Regards
	Daniel
Index: fortran/module.c
===================================================================
--- fortran/module.c	(revision 126413)
+++ fortran/module.c	(working copy)
@@ -651,10 +651,6 @@
 			 "an external module name.", module_name);
 	      goto cleanup;
 	    }
-
-	  if (type == INTERFACE_USER_OP)
-	    new->operator = operator;
-
 	  break;
 
 	case INTERFACE_INTRINSIC_OP:
Index: testsuite/gfortran.dg/operator_6.f90
===================================================================
--- testsuite/gfortran.dg/operator_6.f90	(revision 0)
+++ testsuite/gfortran.dg/operator_6.f90	(revision 0)
@@ -0,0 +1,12 @@
+! { dg-do compile }
+!
+! PR fortran/29876 ICE on bad operator in ONLY clause of USE statement
+! Testcase contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+!
+module foo
+end module foo
+
+program test
+  use foo, only : operator(.none.)
+  end program test
+! { dg-final { cleanup-modules "foo" } }

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