summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-18 23:26:38 +0000
committerkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-18 23:26:38 +0000
commit5b266f8b65eb8ad4424d45c19c2ff674a800d841 (patch)
tree8fdb0f4887a6ae4707e2f001cbaba24f187a8287
parent7e8f55c144b47037b7da7e7d64c7ac0a5ece4600 (diff)
downloadgcc-5b266f8b65eb8ad4424d45c19c2ff674a800d841.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223326 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/interface.c8
-rw-r--r--gcc/fortran/match.c3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/interface_operator_1.f9010
5 files changed, 30 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 0650883fd91..de7be7aa65d 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,11 @@
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
* decl.c(gfc_match_generic): Detected a malformed GENERIC statement.
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 0501c1d1543..d011d846d31 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -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);
}
}
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 8234c277243..3e12483cc0f 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -110,6 +110,9 @@ gfc_op2string (gfc_intrinsic_op op)
case INTRINSIC_PARENTHESES:
return "parens";
+ case INTRINSIC_NONE:
+ return "none";
+
default:
break;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5d4dce2e6f9..a5c147be13a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
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
* gfortran.dg/generic_29.f90: New tests.
diff --git a/gcc/testsuite/gfortran.dg/interface_operator_1.f90 b/gcc/testsuite/gfortran.dg/interface_operator_1.f90
new file mode 100644
index 00000000000..97d260a2b98
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/interface_operator_1.f90
@@ -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" }