aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc.dg/invalid-method-2.m
blob: 0a4bd6390fcdb9f747de3f6dd873f2e18af5b68f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do compile } */

/* Test that using an invalid type in a method declaration produces a
   friendly error without a compiler crash.  */

#if defined(__has_attribute) && __has_attribute(objc_root_class)
__attribute__((objc_root_class))
#endif
@interface MyClass
@end

@implementation MyClass
- (x) method /* { dg-error "unknown type name" } */
{
  return 0;
}
- (id) method2: (x)argument /* { dg-error "unknown type name" } */
{
  return 0;
}
@end