From patchwork Tue Sep 14 14:50:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 64706 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]) by ozlabs.org (Postfix) with SMTP id 58004B6EEC for ; Wed, 15 Sep 2010 00:51:10 +1000 (EST) Received: (qmail 8513 invoked by alias); 14 Sep 2010 14:51:08 -0000 Received: (qmail 8487 invoked by uid 22791); 14 Sep 2010 14:51:08 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from vsmtp1.tin.it (HELO vsmtp1.tin.it) (212.216.176.141) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Sep 2010 14:50:58 +0000 Received: from [192.168.0.4] (79.36.29.105) by vsmtp1.tin.it (8.0.022) id 4B9917F010D60D7C; Tue, 14 Sep 2010 16:50:56 +0200 Message-ID: <4C8F8BCF.2020304@oracle.com> Date: Tue, 14 Sep 2010 16:50:55 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100714 SUSE/3.0.6 Thunderbird/3.0.6 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Jason Merrill Subject: [C++ Patch] PR 45665 X-IsSubscribed: yes 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 Hi, I have this simple patch for an ICE on invalid. Tested x86_64-linux. Is it ok for mainline? Thanks, Paolo. ////////////////// /cp 2010-09-14 Paolo Carlini PR c++/45665 * decl.c (grokdeclarator): Check build_memfn_type return value for error_mark_node. /testsuite 2010-09-14 Paolo Carlini PR c++/45665 * testsuite/g++.dg/template/crash103.C: New. Index: testsuite/g++.dg/template/crash103.C =================================================================== --- testsuite/g++.dg/template/crash103.C (revision 0) +++ testsuite/g++.dg/template/crash103.C (revision 0) @@ -0,0 +1,4 @@ +// PR c++/45665 + +template < typename > struct S; +void (S <0>::*ptr) (); // { dg-error "type" } Index: cp/decl.c =================================================================== --- cp/decl.c (revision 164279) +++ cp/decl.c (working copy) @@ -8762,6 +8762,8 @@ grokdeclarator (const cp_declarator *declarator, type = build_memfn_type (type, declarator->u.pointer.class_type, memfn_quals); + if (type == error_mark_node) + return error_mark_node; memfn_quals = TYPE_UNQUALIFIED; }