Message ID | 20150515152345.GH82729@troutmask.apl.washington.edu |
---|---|
State | New |
Headers | show |
Does it also catch the other cases shown in the PR? Things like: generic :: 2 generic :: 2 = generic :: 1 => x generic :: ? etc. OK if so. If not, maybe it’s worth adding them at the same time? FX
On Fri, May 15, 2015 at 10:37:24PM +0200, FX wrote: > Does it also catch the other cases shown in the PR? Things like: > > generic :: 2 > generic :: 2 = > generic :: 1 => x > generic :: ? > Yes, the patch appears to catch those as well.
> Yes, the patch appears to catch those as well.
Then: OK to commit.
Thanks!
FX
Index: gcc/fortran/decl.c =================================================================== --- gcc/fortran/decl.c (revision 223094) +++ gcc/fortran/decl.c (working copy) @@ -8510,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 (); } Index: gcc/testsuite/gfortran.dg/generic_29.f90 =================================================================== --- gcc/testsuite/gfortran.dg/generic_29.f90 (revision 0) +++ gcc/testsuite/gfortran.dg/generic_29.f90 (working copy) @@ -0,0 +1,11 @@ +! { dg-do compile} +! PR fortran/66057 +! +! Original code from Gerhard Steinmetz +! <gerhard dot steinmetz dot fortran at t-online dot de> +program p + type t + contains + generic :: ! { dg-error "Malformed GENERIC" } + end type +end