From patchwork Tue Jul 6 19:13:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 58055 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 29FC4B6EF2 for ; Wed, 7 Jul 2010 05:13:46 +1000 (EST) Received: (qmail 31595 invoked by alias); 6 Jul 2010 19:13:45 -0000 Received: (qmail 31585 invoked by uid 22791); 6 Jul 2010 19:13:44 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Jul 2010 19:13:36 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o66JDZmP014254 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 6 Jul 2010 15:13:35 -0400 Received: from [IPv6:::1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o66JDYJZ013271 for ; Tue, 6 Jul 2010 15:13:34 -0400 Message-ID: <4C33805E.3090809@redhat.com> Date: Tue, 06 Jul 2010 15:13:34 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.10) Gecko/20100619 Lightning/1.0b1 Shredder/3.0.6pre MIME-Version: 1.0 To: gcc-patches List Subject: Minor C++ PATCH to dump_function_decl 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 While debugging 43120, I noticed that dump_function_decl was crashing on a thunk FUNCTION_DECLs that didn't have a name yet. Tested x86_64-pc-linux-gnu, applied to trunk. commit 764fc0c6462f715407b98724c90e0b77580fabe2 Author: Jason Merrill Date: Fri Jul 2 23:51:52 2010 -0400 * error.c (dump_function_decl): Don't crash on null DECL_NAME. diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 1902a13..cff822a 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1247,7 +1247,7 @@ dump_function_decl (tree t, int flags) tree exceptions; VEC(tree,gc) *typenames = NULL; - if (LAMBDA_FUNCTION_P (t)) + if (DECL_NAME (t) && LAMBDA_FUNCTION_P (t)) { /* A lambda's signature is essentially its "type", so defer. */ gcc_assert (LAMBDA_TYPE_P (DECL_CONTEXT (t)));