2013-10-29 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / obj-c++.dg / syntax-error-1.mm
blob1fe9ca3c4b0b159308dd0a3f55375f11c075550d
1 /* Graceful handling of a syntax error.  */
2 /* { dg-do compile } */
4 #ifdef __NEXT_RUNTIME__
5 #include <Foundation/NSObject.h>
6 #define OBJECT NSObject
7 #else
8 #include <objc/Object.h>
9 #define OBJECT Object
10 #endif
12 class foo {
13   public:
14     foo();
15     virtual ~foo();
19 extern void NXLog(const char *, ...);
21 @interface Test2 : OBJECT {
23 - (void) foo2;
24 @end
26 @implementation Test2
27 - (void) foo2
28   NXLog("Hello, world!"); /* { dg-error "expected .\{. before .NXLog." } */
29 } /* { dg-error "stray .\}. between Objective\\-C\\+\\+ methods" } */
30 @end
32 /* { dg-error "expected constructor, destructor, or type conversion before" "" { target *-*-* } 28 } */