re PR fortran/66057 (ICE for incomplete generic statement (gfc_match_generic))
authorSteven G. Kargl <kargl@gcc.gnu.org>
Mon, 18 May 2015 23:26:38 +0000 (23:26 +0000)
committerSteven G. Kargl <kargl@gcc.gnu.org>
Mon, 18 May 2015 23:26:38 +0000 (23:26 +0000)
2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/66057
* interface.c(gfc_match_end_interface): Enforce F2008 C1202 (R1201).
* match.c(gfc_op2string): Return 'none' for INTRINSIC_NONE.

2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/66057
* gfortran.dg/interface_operator_1.f90: New tests.

From-SVN: r223326

gcc/fortran/ChangeLog
gcc/fortran/interface.c
gcc/fortran/match.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/interface_operator_1.f90 [new file with mode: 0644]

index 0650883fd919c418e1c20997da9d35e0129af902..de7be7aa65d72070ad0612f1ac21a662540d813c 100644 (file)
@@ -1,3 +1,9 @@
+2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/66106
+       * interface.c(gfc_match_end_interface): Enforce F2008 C1202 (R1201).
+       * match.c(gfc_op2string): Return 'none' for INTRINSIC_NONE.
+
 2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/66057
index 0501c1d15438d955e6e709bdb96d0bbc7b6e69cc..d011d846d315cb30dafadf34c48b493f111086a3 100644 (file)
@@ -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 8234c2772433503772c996ad02a76556f3aef952..3e12483cc0fcabd0db02105c1aeec8b40f8c311c 100644 (file)
@@ -110,6 +110,9 @@ gfc_op2string (gfc_intrinsic_op op)
     case INTRINSIC_PARENTHESES:
       return "parens";
 
+    case INTRINSIC_NONE:
+      return "none";
+
     default:
       break;
     }
index 5d4dce2e6f9a27b01245f0988bc5b4ac52fa3c9d..a5c147be13a9efd75b000e2665f11465800316af 100644 (file)
@@ -1,3 +1,8 @@
+2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/66106
+       * gfortran.dg/interface_operator_1.f90: New tests.
+
 2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/66057
diff --git a/gcc/testsuite/gfortran.dg/interface_operator_1.f90 b/gcc/testsuite/gfortran.dg/interface_operator_1.f90
new file mode 100644 (file)
index 0000000..97d260a
--- /dev/null
@@ -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" }