fix pr/45972
[official-gcc.git] / gcc / testsuite / obj-c++.dg / syntax-error-1.mm
blob13f3c275cce6be66df6628a2509ca7c847d20dc5
1 /* Graceful handling of a syntax error.  */
2 /* { dg-do compile } */
4 #include <objc/Object.h>
6 class foo {
7   public:
8     foo();
9     virtual ~foo();
13 extern void NXLog(const char *, ...);
15 @interface Test2 : Object {
17 - (void) foo2;
18 @end
20 @implementation Test2
21 - (void) foo2
22   NXLog("Hello, world!"); /* { dg-error "expected .\{. before .NXLog." } */
23 } /* { dg-error "stray .\}. between Objective\\-C\\+\\+ methods" } */
24 @end
26 /* { dg-error "expected constructor, destructor, or type conversion before" "" { target *-*-* } 22 } */