Regression tested on trunk. OK to commit?
The patch allows gfortran to check a portion of C1202
that was previously mishandled.
2015-05-XX Steven G. Kargl <[email protected]>
PR fortran/66057
* interface.c(gfc_match_end_interface): Enfornce F2008 C1202 (R1201).
2015-05-XX Steven G. Kargl <[email protected]>
PR fortran/66057
* gfortran.dg/interface_operator_1.f90: New tests.
--
Steve
Index: gcc/fortran/interface.c
===================================================================
--- gcc/fortran/interface.c (revision 223094)
+++ gcc/fortran/interface.c (working copy)
@@ -346,8 +346,12 @@ gfc_match_end_interface (void)
break;
m = MATCH_ERROR;
- gfc_error ("Expecting %<END INTERFACE OPERATOR (%s)%> at %C, "
- "but got %s", s1, s2);
+ if (strcmp(s2, "none") == 0)
+ gfc_error ("Expecting %<END INTERFACE OPERATOR (%s)%> "
+ "at %C, ", s1);
+ else
+ gfc_error ("Expecting %<END INTERFACE OPERATOR (%s)%> at %C, "
+ "but got %s", s1, s2);
}
}
Index: gcc/testsuite/gfortran.dg/interface_operator_1.f90
===================================================================
--- gcc/testsuite/gfortran.dg/interface_operator_1.f90 (revision 0)
+++ gcc/testsuite/gfortran.dg/interface_operator_1.f90 (working copy)
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! PR fortran/66106
+!
+! Original code from Gerhard Steinmetz
+! <gerhard dot steinmetz dot fortran at t-online dot de>
+program p
+ interface operator ( .gt. )
+ end interface operator ! { dg-error "END INTERFACE OPERATOR" }
+end program p ! { dg-error "END INTERFACE" }
+! { dg-excess-errors "Unexpected end of file" }