From patchwork Fri May 15 15:23:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Kargl X-Patchwork-Id: 472840 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 88BFF1409BB for ; Sat, 16 May 2015 01:24:01 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=Kf6OYNMf; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=JGdAquoh8m+g7Zo3fz6wQhrIGAPE66dNQj2LEKhhrYikR2IwSz9VT Q6QO1V32pJuK5/Np9dxBYrJ7tgRNsgBRaBe/o08bDkmEmfn3y/gMzxBM3gqUxAZE fB9EAgHe51nbduPvMIDMgymOATydgWOleJmjB5TDos2VVmjMWCT+rw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=VzkKBRdL+VxsuXs9noO0yKTQnUM=; b=Kf6OYNMfbwZsL4xVmDnO loMHlReVYYyG6OI+F1Ufjpv/lYTLXdpzNW2zBwxkGCobc00feYWA94ToQP/02i8z HRQ8kYQlxNL/gyH2t3Z9C1xq4414vZXZt49lXtC/2c9kwS3aXN//g8kFmtYYLu0K /u4PuqJfVYcKIcbufgD6og4= Received: (qmail 94477 invoked by alias); 15 May 2015 15:23:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 94460 invoked by uid 89); 15 May 2015 15:23:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL, BAYES_50, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: troutmask.apl.washington.edu Received: from troutmask.apl.washington.edu (HELO troutmask.apl.washington.edu) (128.95.76.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 15 May 2015 15:23:47 +0000 Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.14.9/8.14.9) with ESMTP id t4FFNjwR083072 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 15 May 2015 08:23:45 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.9/8.14.9/Submit) id t4FFNjpo083071; Fri, 15 May 2015 08:23:45 -0700 (PDT) (envelope-from sgk) Date: Fri, 15 May 2015 08:23:45 -0700 From: Steve Kargl To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] fortran/66057 -- detect malformed GENERIC statement Message-ID: <20150515152345.GH82729@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Regression tested on trunk. OK to commit? See the test case for the type of error that this patch catches. 2015-05-XX Steven G. Kargl PR fortran/66057 * decl.c(gfc_match_generic): Detected a malformed GENERIC statement. 2015-05-XX Steven G. Kargl PR fortran/66057 * gfortran.dg/generic_29.f90: New tests. 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 +! +program p + type t + contains + generic :: ! { dg-error "Malformed GENERIC" } + end type +end