summaryrefslogtreecommitdiff
path: root/gcc/testsuite/obj-c++.dg/invalid-method-2.mm
blob: 8eee0ff6432767ccb2b75f1995c0fb2c7c60287b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile } */
// { dg-additional-options "-Wno-objc-root-class" }

/* 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|type" } */
{
  return 0;
}
- (id) method2: (x)argument /* { dg-error "expected|type" } */
{
  return 0;
}
@end