From: Ziemowit Laski <zlaski@apple.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: PATCH: Allow ObjC qualifiers in ObjC selector names
Date: Mon, 18 Oct 2004 22:25:00 -0000 [thread overview]
Message-ID: <BB783016-2153-11D9-82EA-000D9330C50E@apple.com> (raw)
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 <zlaski@apple.com>
* c-parse.in (reservedwords): Add OBJC_TYPE_QUAL as alternative.
[gcc/testsuite/ChangeLog]
2004-10-18 Ziemowit Laski <zlaski@apple.com>
* 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 <zlaski@apple.com>. */
+/* { 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:" } } */
reply other threads:[~2004-10-18 22:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BB783016-2153-11D9-82EA-000D9330C50E@apple.com \
--to=zlaski@apple.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).