* PATCH: Allow ObjC qualifiers in ObjC selector names
@ 2004-10-18 22:25 Ziemowit Laski
0 siblings, 0 replies; only message in thread
From: Ziemowit Laski @ 2004-10-18 22:25 UTC (permalink / raw)
To: GCC Patches
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:" } } */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-10-18 22:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-18 22:25 PATCH: Allow ObjC qualifiers in ObjC selector names Ziemowit Laski
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).