From patchwork Mon May 21 21:41:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 160486 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 4E92AB6F9A for ; Tue, 22 May 2012 07:41:47 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1338241307; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=WlXlS9f Iaz+qvF9SWp3A0VaBFik=; b=kiooloVObcedhLlGHZARsy5cLi4sRXwLLOvexCX 1oEFG+OiwK/g9PcPxYtFXDV14TaaRTIjGdSh/j49150kEiU/ds28nMf09t5aC08M ZKQOqKRhFlD2nORwRIj/wOJC0sS6dB2+IvzFuHWkhBRGx0/b6KBMoepVkiOy6dM8 Wkjc= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=LP0ArsTBb+p6e6upG1KU2Zx2RmbH4vID3kBRqezLKXI9XCgdiaHItItcvzap1j hQaVXoAX2T8yIlyrBhxM/3b6Wrj6adLyuUUVYNRTNCYadWnmWPMjQMN+PTTSR7Qi e8ujrLwbgPKawzgbr7Q/l3dMQr1W0aHFxBIDYgXvufre4=; Received: (qmail 24255 invoked by alias); 21 May 2012 21:41:42 -0000 Received: (qmail 24239 invoked by uid 22791); 21 May 2012 21:41:40 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-yx0-f175.google.com (HELO mail-yx0-f175.google.com) (209.85.213.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 21 May 2012 21:41:28 +0000 Received: by yenl13 with SMTP id l13so5069525yen.20 for ; Mon, 21 May 2012 14:41:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.146.72 with SMTP id q48mr13541453yhj.98.1337636487652; Mon, 21 May 2012 14:41:27 -0700 (PDT) Received: by 10.147.111.19 with HTTP; Mon, 21 May 2012 14:41:27 -0700 (PDT) Date: Mon, 21 May 2012 23:41:27 +0200 Message-ID: Subject: [PATCH, c++]: Fix PR 53441, [4.8 Regression] obj-c++.dg/ivar-invalid-type-1.mm ICE From: Uros Bizjak To: gcc-patches@gcc.gnu.org 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 Hello! As shown in the PR, ivar-invalid-type-1 ICEs in constructor_name_p, due to accessor on NULL "type" argument. The one-liner patch fixes the ICE by adding a guard that checks that current_class_type is non-NULL before calling constructor_name_p. 2012-05-21 Uros Bizjak PR obj-c++/53441 * decl.c (grokdeclarator): Check that current_class_type is non-NULL before calling constructor_name_p. Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu {,-m32}. OK for mainline SVN? Uros. Index: decl.c =================================================================== --- decl.c (revision 187736) +++ decl.c (working copy) @@ -9803,7 +9803,8 @@ grokdeclarator (const cp_declarator *declarator, clones. */ DECL_ABSTRACT (decl) = 1; } - else if (constructor_name_p (unqualified_id, current_class_type)) + else if (current_class_type + && constructor_name_p (unqualified_id, current_class_type)) permerror (input_location, "ISO C++ forbids nested type %qD with same name " "as enclosing class", unqualified_id);