diff options
Diffstat (limited to 'gcc/testsuite/obj-c++.dg/invalid-method-2.mm')
-rw-r--r-- | gcc/testsuite/obj-c++.dg/invalid-method-2.mm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/obj-c++.dg/invalid-method-2.mm b/gcc/testsuite/obj-c++.dg/invalid-method-2.mm new file mode 100644 index 000000000..48f03599c --- /dev/null +++ b/gcc/testsuite/obj-c++.dg/invalid-method-2.mm @@ -0,0 +1,18 @@ +/* { dg-do compile } */ + +/* Test that using an invalid type in a method declaration produces a + friendly error without a compiler crash. */ + +@interface MyClass +@end + +@implementation MyClass +- (x) method /* { dg-error "expected" } */ +{ + return 0; +} +- (id) method2: (x)argument /* { dg-error "expected" } */ +{ + return 0; +} +@end |