| 1 |
/* Graceful handling of a syntax error. */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* Suppress warnings that the GNUStep headers introduce. */ |
| 4 |
/* { dg-additional-options "-std=gnu++11 -Wno-expansion-to-defined -Wno-variadic-macros" { target *-*-darwin* } } */ |
| 5 |
|
| 6 |
#ifdef __NEXT_RUNTIME__ |
| 7 |
#include "../objc-obj-c++-shared/F-NSObject.h" |
| 8 |
#define OBJECT NSObject |
| 9 |
#else |
| 10 |
#include <objc/Object.h> |
| 11 |
#define OBJECT Object |
| 12 |
#endif |
| 13 |
|
| 14 |
class foo { |
| 15 |
public: |
| 16 |
foo(); |
| 17 |
virtual ~foo(); |
| 18 |
}; |
| 19 |
|
| 20 |
|
| 21 |
extern void NXLog(const char *, ...); |
| 22 |
|
| 23 |
@interface Test2 : OBJECT { |
| 24 |
} |
| 25 |
- (void) foo2; |
| 26 |
@end |
| 27 |
|
| 28 |
@implementation Test2 |
| 29 |
- (void) foo2 |
| 30 |
NXLog("Hello, world!"); /* { dg-line Test2_foo2_body } */ |
| 31 |
/* { dg-error "expected .\{. before .NXLog." "" { target *-*-* } Test2_foo2_body } */ |
| 32 |
} /* { dg-error "stray .\}. between Objective\\-C\\+\\+ methods" } */ |
| 33 |
@end |
| 34 |
|
| 35 |
/* { dg-error "expected constructor, destructor, or type conversion before" "" { target *-*-* } Test2_foo2_body } */ |