summaryrefslogtreecommitdiff
path: root/gcc/testsuite/obj-c++.dg/syntax-error-1.mm
blob: 13f3c275cce6be66df6628a2509ca7c847d20dc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* Graceful handling of a syntax error.  */
/* { dg-do compile } */

#include <objc/Object.h>

class foo {
  public:
    foo();
    virtual ~foo();
};


extern void NXLog(const char *, ...);

@interface Test2 : Object {
}
- (void) foo2;
@end

@implementation Test2
- (void) foo2
  NXLog("Hello, world!"); /* { dg-error "expected .\{. before .NXLog." } */
} /* { dg-error "stray .\}. between Objective\\-C\\+\\+ methods" } */
@end

/* { dg-error "expected constructor, destructor, or type conversion before" "" { target *-*-* } 22 } */