diff options
Diffstat (limited to 'gcc/testsuite/objc.dg/class-extension-4.m')
-rw-r--r-- | gcc/testsuite/objc.dg/class-extension-4.m | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/class-extension-4.m b/gcc/testsuite/objc.dg/class-extension-4.m new file mode 100644 index 000000000..692a0fcbd --- /dev/null +++ b/gcc/testsuite/objc.dg/class-extension-4.m @@ -0,0 +1,19 @@ +/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */ +/* { dg-do compile } */ + +/* This test tests you can not declare a class extension after the class @implementation. */ + +#include <objc/objc.h> + +@interface MyObject +{ + Class isa; +} +@end + +@implementation MyObject +@end + +@interface MyObject () +- (void) test; /* { dg-error "class extension for class .MyObject. declared after its ..implementation." } */ +@end |