From 377e37c15987acaaddd0e51282adb40d49e91758 Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Mon, 18 May 2015 23:09:49 +0000 Subject: [PATCH] re PR fortran/66057 (ICE for incomplete generic statement (gfc_match_generic)) 2015-05-18 Steven G. Kargl PR fortran/66057 * decl.c(gfc_match_generic): Detected a malformed GENERIC statement. 2015-05-18 Steven G. Kargl PR fortran/66057 * gfortran.dg/generic_29.f90: New tests. From-SVN: r223325 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/decl.c | 5 +++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/generic_29.f90 | 11 +++++++++++ 4 files changed, 26 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/generic_29.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f54de3c335b..0650883fd91 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2015-05-18 Steven G. Kargl + + PR fortran/66057 + * decl.c(gfc_match_generic): Detected a malformed GENERIC statement. + 2015-05-18 Steven G. Kargl PR fortran/66043 diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 93a4554343f..086a20ea6d8 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -8511,6 +8511,11 @@ gfc_match_generic (void) gfc_op2string (op)); break; + case INTERFACE_NAMELESS: + gfc_error ("Malformed GENERIC statement at %C"); + goto error; + break; + default: gcc_unreachable (); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fa8dc0a2086..5d4dce2e6f9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-05-18 Steven G. Kargl + + PR fortran/66057 + * gfortran.dg/generic_29.f90: New tests. + 2015-05-18 Steven G. Kargl PR fortran/66043 diff --git a/gcc/testsuite/gfortran.dg/generic_29.f90 b/gcc/testsuite/gfortran.dg/generic_29.f90 new file mode 100644 index 00000000000..6f95b56c5b8 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/generic_29.f90 @@ -0,0 +1,11 @@ +! { dg-do compile} +! PR fortran/66057 +! +! Original code from Gerhard Steinmetz +! +program p + type t + contains + generic :: ! { dg-error "Malformed GENERIC" } + end type +end -- 2.30.2