re PR fortran/66057 (ICE for incomplete generic statement (gfc_match_generic))

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
This commit is contained in:
Steven G. Kargl 2015-05-18 23:26:38 +00:00
parent 377e37c159
commit 898344a944
5 changed files with 30 additions and 2 deletions

View 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

View 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);
}
}

View File

@ -110,6 +110,9 @@ gfc_op2string (gfc_intrinsic_op op)
case INTRINSIC_PARENTHESES:
return "parens";
case INTRINSIC_NONE:
return "none";
default:
break;
}

View 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

View File

@ -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" }