From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2590 invoked by alias); 18 Oct 2004 22:19:35 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 2579 invoked from network); 18 Oct 2004 22:19:33 -0000 Received: from unknown (HELO mail-out3.apple.com) (17.254.13.22) by sourceware.org with SMTP; 18 Oct 2004 22:19:33 -0000 Received: from mailgate2.apple.com (a17-128-100-204.apple.com [17.128.100.204]) by mail-out3.apple.com (8.12.11/8.12.11) with ESMTP id i9IMODnB004648 for ; Mon, 18 Oct 2004 15:24:13 -0700 (PDT) Received: from relay1.apple.com (relay1.apple.com) by mailgate2.apple.com (Content Technologies SMTPRS 4.3.14) with ESMTP id for ; Mon, 18 Oct 2004 15:19:33 -0700 Received: from [17.201.24.57] (polskifiat.apple.com [17.201.24.57]) by relay1.apple.com (8.12.11/8.12.11) with ESMTP id i9IMJVZM001810 for ; Mon, 18 Oct 2004 15:19:32 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v619) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; format=flowed To: GCC Patches From: Ziemowit Laski Subject: PATCH: Allow ObjC qualifiers in ObjC selector names Date: Mon, 18 Oct 2004 22:25:00 -0000 X-SW-Source: 2004-10/txt/msg01567.txt.bz2 This slipped by unnoticed during the recent c-parse.in ObjC rewrite. The "in", "out", "inout", "byway", "byref" and "oneway" context-sensitive qualifiers (which now have the their very own OBJC_TYPE_QUAL %token) must also be allowed to appear as selector names in methods (see test case below), as they have been previously. Thankfully, the fix boils down to adding a single Yacc unit rule. I will commit this as obvious. --Zem [gcc/ChangeLog] 2004-10-18 Ziemowit Laski * c-parse.in (reservedwords): Add OBJC_TYPE_QUAL as alternative. [gcc/testsuite/ChangeLog] 2004-10-18 Ziemowit Laski * objc.dg/method-14.m: New test. Index: gcc/c-parse.in =================================================================== RCS file: /cvs/gcc/gcc/gcc/c-parse.in,v retrieving revision 1.249 diff -u -3 -p -r1.249 c-parse.in --- gcc/c-parse.in 16 Oct 2004 23:19:07 -0000 1.249 +++ gcc/c-parse.in 18 Oct 2004 21:58:06 -0000 @@ -2889,7 +2889,7 @@ reservedwords: ENUM | STRUCT | UNION | IF | ELSE | WHILE | DO | FOR | SWITCH | CASE | DEFAULT | BREAK | CONTINUE | RETURN | GOTO | ASM_KEYWORD | SIZEOF | TYPEOF | ALIGNOF - | TYPESPEC | TYPE_QUAL + | TYPESPEC | TYPE_QUAL | OBJC_TYPE_QUAL ; objc_qual: Index: gcc/testsuite/objc.dg/method-14.m =================================================================== RCS file: gcc/testsuite/objc.dg/method-14.m diff -N gcc/testsuite/objc.dg/method-14.m --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gcc/testsuite/objc.dg/method-14.m 18 Oct 2004 21:58:18 -0000 @@ -0,0 +1,17 @@ +/* Test if context-sensitive "in", "out", "byref", etc., qualifiers can be + used as method selectors. */ +/* Author: Ziemowit Laski . */ +/* { dg-do compile } */ + +@interface Foo +- (void)insertNewButtonImage:(Foo *)newButtonImage in:(Foo *)buttonCell; ++ (oneway void)oneway:(int)i2 byref:(int)i3 out:(float)f4 bycopy:(float)f5; +@end + +@implementation Foo +- (void)insertNewButtonImage:(Foo *)newButtonImage in:(Foo *)buttonCell { } ++ (oneway void)oneway:(int)i2 byref:(int)i3 out:(float)f4 bycopy:(float)f5 { } +@end + +/* { dg-final { scan-assembler "insertNewButtonImage:in:" } } */ +/* { dg-final { scan-assembler "oneway:byref:out:bycopy:" } } */