gcc/testsuite/obj-c++.dg/invalid-method-2.mm
raw| 1 | /* { dg-do compile } */ |
| 2 | // { dg-additional-options "-Wno-objc-root-class" } |
| 3 | |
| 4 | /* Test that using an invalid type in a method declaration produces a |
| 5 | friendly error without a compiler crash. */ |
| 6 | |
| 7 | @interface MyClass |
| 8 | @end |
| 9 | |
| 10 | @implementation MyClass |
| 11 | - (x) method /* { dg-error "expected|type" } */ |
| 12 | { |
| 13 | return 0; |
| 14 | } |
| 15 | - (id) method2: (x)argument /* { dg-error "expected|type" } */ |
| 16 | { |
| 17 | return 0; |
| 18 | } |
| 19 | @end |