aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrth <>2006-01-05 21:06:47 +0000
committerrth <>2006-01-05 21:06:47 +0000
commit08e46a4449305d224316c6a4b194416b54639d5e (patch)
tree6958c989792a6d8aa787334e7df27e2397ad1119
parentf260e52e6e1adf3a916fcfb3950ba360247dc538 (diff)
* c-parser.c (c_parser_objc_methodprotolist): Handle CPP_PRAGMA.
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/c-parser.c3
-rw-r--r--gcc/testsuite/objc.dg/pragma-1.m26
3 files changed, 12 insertions, 21 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 632e4b38e39..99809f0d4fa 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2006-01-05 Richard Henderson <rth@redhat.com>
+
+ * c-parser.c (c_parser_objc_methodprotolist): Handle CPP_PRAGMA.
+
2006-01-05 Carlos O'Donell <carlos@codesourcery.com>
* c-typeck.c: Update copyright date.
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index eff5b832347..91a9d299ca0 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -5866,6 +5866,9 @@ c_parser_objc_methodprotolist (c_parser *parser)
case CPP_MINUS:
c_parser_objc_methodproto (parser);
break;
+ case CPP_PRAGMA:
+ c_parser_pragma (parser, pragma_external);
+ break;
case CPP_EOF:
return;
default:
diff --git a/gcc/testsuite/objc.dg/pragma-1.m b/gcc/testsuite/objc.dg/pragma-1.m
index 14c4d7928a2..0c3010dcf30 100644
--- a/gcc/testsuite/objc.dg/pragma-1.m
+++ b/gcc/testsuite/objc.dg/pragma-1.m
@@ -1,23 +1,7 @@
-/* It is OK to use #pragma inside @implementation body. This test checks that. */
-/* Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do compile { target *-*-darwin* } } */
+/* ??? Is there a better pragma that is handled for all targets, not
+ handled by the preprocessor, that would be better for testing here? */
-@interface A
-{
- int p;
-}
-+(int) foo;
--(int) bar;
-@end
-
-@implementation A
-#pragma mark -
-#pragma mark init / dealloc
-+ (int)foo {
- return 1;
-}
-#pragma mark -
-#pragma mark Private Functions
-- (int)bar {
- return 2;
-}
+@interface a {}
+#pragma mark --- Output ---
@end