From patchwork Thu Oct 7 17:21:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Pero X-Patchwork-Id: 67082 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 8D422B6EF2 for ; Fri, 8 Oct 2010 04:21:26 +1100 (EST) Received: (qmail 22535 invoked by alias); 7 Oct 2010 17:21:24 -0000 Received: (qmail 22526 invoked by uid 22791); 7 Oct 2010 17:21:23 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL, BAYES_00, TW_BJ, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Oct 2010 17:21:15 +0000 Received: from eggs.gnu.org ([140.186.70.92]:45407) by fencepost.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1P3u9Z-0007Af-6s for gcc-patches@gnu.org; Thu, 07 Oct 2010 13:21:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P3u9X-0000xO-2R for gcc-patches@gnu.org; Thu, 07 Oct 2010 13:21:13 -0400 Received: from smtp161.iad.emailsrvr.com ([207.97.245.161]:36392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P3u9X-0000xK-08 for gcc-patches@gnu.org; Thu, 07 Oct 2010 13:21:11 -0400 Received: from relay16.relay.iad.mlsrvr.com (localhost [127.0.0.1]) by relay16.relay.iad.mlsrvr.com (SMTP Server) with ESMTP id A64861B416F for ; Thu, 7 Oct 2010 13:21:10 -0400 (EDT) Received: from dynamic3.wm-web.iad.mlsrvr.com (dynamic3.wm-web.iad.mlsrvr.com [192.168.2.152]) by relay16.relay.iad.mlsrvr.com (SMTP Server) with ESMTP id 8C0901B416D for ; Thu, 7 Oct 2010 13:21:10 -0400 (EDT) Received: from meta-innovation.com (localhost [127.0.0.1]) by dynamic3.wm-web.iad.mlsrvr.com (Postfix) with ESMTP id 71DF9332006E for ; Thu, 7 Oct 2010 13:21:10 -0400 (EDT) Received: by www2.webmail.us (Authenticated sender: nicola.pero@meta-innovation.com, from: nicola.pero@meta-innovation.com) with HTTP; Thu, 7 Oct 2010 19:21:10 +0200 (CEST) Date: Thu, 7 Oct 2010 19:21:10 +0200 (CEST) Subject: RE: Fix for PR objc++/23614 From: "Nicola Pero" To: "gcc-patches@gnu.org" MIME-Version: 1.0 X-Type: plain In-Reply-To: <1286308732.39247124@192.168.2.231> References: <1286308732.39247124@192.168.2.231> Message-ID: <1286472070.464832278@192.168.2.231> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 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 Ping ... Ok to commit ? :-) Thanks -----Original Message----- From: "Nicola Pero" Sent: Tuesday, 5 October, 2010 21:58 To: "gcc-patches@gnu.org" Subject: Fix for PR objc++/23614 This patch fixes PR objc++/23614. It was not a bug in the ObjC++ compiler; it was a bug in the test. The compiler barfed on: class MyWidget { public: int a; MyWidget(void) { a = 17; } }; MyWidget *widget = nil; and I think the compiler is correct in barfing, because widget is a pointer to a C++ class, and you can't assign 'nil' to it. Note that this assignment seems irrelevant in the test, which was testing something else. Thanks Index: ChangeLog =================================================================== --- ChangeLog (revision 164997) +++ ChangeLog (working copy) @@ -1,5 +1,11 @@ 2010-10-05 Nicola Pero + PR objc++/23614 + * obj-c++.dg/lookup-2.mm: Do not assign 'nil' to a pointer to a + C++ class. Removed XFAIL. + +2010-10-05 Nicola Pero + PR objc++/28050 * obj-c++.dg/syntax-error-10.mm: New. Index: obj-c++.dg/lookup-2.mm =================================================================== --- obj-c++.dg/lookup-2.mm (revision 164996) +++ obj-c++.dg/lookup-2.mm (working copy) @@ -1,5 +1,4 @@ /* { dg-do run } */ -/* { dg-xfail-if "PR23614" { "*-*-*" } { "*" } { "-fnext-runtime" } } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ #include "../objc-obj-c++-shared/Object1.h" #include @@ -38,7 +37,7 @@ MyWidget gWidget; @implementation Container + (MyWidget *)elementForView:(Foo *)view { - MyWidget *widget = nil; + MyWidget *widget = NULL; if ([view conformsTo:@protocol(MyProto)]) { widget = [(Foo *)view widget]; }