From patchwork Sun Oct 17 22:34:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Pero X-Patchwork-Id: 68098 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 52CF8B70EC for ; Mon, 18 Oct 2010 09:35:01 +1100 (EST) Received: (qmail 5926 invoked by alias); 17 Oct 2010 22:34:59 -0000 Received: (qmail 5827 invoked by uid 22791); 17 Oct 2010 22:34:58 -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; Sun, 17 Oct 2010 22:34:53 +0000 Received: from eggs.gnu.org ([140.186.70.92]:52458) by fencepost.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1P7boa-0001dV-14 for gcc-patches@gnu.org; Sun, 17 Oct 2010 18:34:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P7boV-0007LC-Rv for gcc-patches@gnu.org; Sun, 17 Oct 2010 18:34:51 -0400 Received: from smtp141.iad.emailsrvr.com ([207.97.245.141]:32867) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P7boV-0007Kk-PC for gcc-patches@gnu.org; Sun, 17 Oct 2010 18:34:47 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp34.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 396633801A7 for ; Sun, 17 Oct 2010 18:34:47 -0400 (EDT) X-Orig-To: gcc-patches@gnu.org Received: from dynamic9.wm-web.iad.mlsrvr.com (dynamic9.wm-web.iad1a.rsapps.net [192.168.2.216]) by smtp34.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 1E576380178 for ; Sun, 17 Oct 2010 18:34:47 -0400 (EDT) Received: from meta-innovation.com (localhost [127.0.0.1]) by dynamic9.wm-web.iad.mlsrvr.com (Postfix) with ESMTP id 107C0320088 for ; Sun, 17 Oct 2010 18:34:47 -0400 (EDT) Received: by www2.webmail.us (Authenticated sender: nicola.pero@meta-innovation.com, from: nicola.pero@meta-innovation.com) with HTTP; Mon, 18 Oct 2010 00:34:47 +0200 (CEST) Date: Mon, 18 Oct 2010 00:34:47 +0200 (CEST) Subject: ObjC++ - another small parser bugfix merge from apple/trunk From: "Nicola Pero" To: "gcc-patches@gnu.org" MIME-Version: 1.0 X-Type: plain Message-ID: <1287354887.065618517@192.168.2.228> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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 Another bugfix for the ObjC++ parser (with testcase) merge from the apple/trunk. Committed to trunk (preapproved by Mike). Thanks Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (revision 165601) +++ gcc/testsuite/ChangeLog (working copy) @@ -1,7 +1,16 @@ 2010-10-17 Nicola Pero Merge from 'apple/trunk' branch on FSF servers. + + 2006-04-19 Fariborz Jahanian + Radar 4516785 + * obj-c++.dg/method-namespace-2.mm: New. + +2010-10-17 Nicola Pero + + Merge from 'apple/trunk' branch on FSF servers. + 2006-03-27 Fariborz Jahanian Radar 4133425 Index: gcc/testsuite/obj-c++.dg/method-namespace-2.mm =================================================================== --- gcc/testsuite/obj-c++.dg/method-namespace-2.mm (revision 0) +++ gcc/testsuite/obj-c++.dg/method-namespace-2.mm (revision 0) @@ -0,0 +1,25 @@ +/* Test that qualified type is resolved to its proper type. */ +/* { dg-do compile } */ + +@interface Object +{ + int I[100]; +} +@end + +namespace HC +{ + +struct Object +{ + void test(); +}; + +} // namespace HC + +int main() +{ + HC::Object* object; + object->test(); // Must compile with no error + return 0; +} Index: gcc/cp/ChangeLog =================================================================== --- gcc/cp/ChangeLog (revision 165601) +++ gcc/cp/ChangeLog (working copy) @@ -1,7 +1,17 @@ 2010-10-17 Nicola Pero Merge from apple/trunk branch on FSF servers. + + 2006-04-19 Fariborz Jahanian + + Radar 4516785 + * parser.c (cp_parser_simple_type_specifier): Don't lookup for + objc object types if type is scope qualified. +2010-10-17 Nicola Pero + + Merge from apple/trunk branch on FSF servers. + 2006-03-27 Fariborz Jahanian Radar 4133425 Index: gcc/cp/parser.c =================================================================== --- gcc/cp/parser.c (revision 165600) +++ gcc/cp/parser.c (working copy) @@ -12753,7 +12753,7 @@ cp_parser_simple_type_specifier (cp_parser* parser /* As a last-ditch effort, see if TYPE is an Objective-C type. If it is, then the '<'...'>' enclose protocol names rather than template arguments, and so everything is fine. */ - if (c_dialect_objc () + if (c_dialect_objc () && !parser->scope && (objc_is_id (type) || objc_is_class_name (type))) { tree protos = cp_parser_objc_protocol_refs_opt (parser);