xref: /llvm-project/clang/test/SemaObjCXX/goto.mm (revision acfbe9e1f22886d82c503cd0c20dc0ef3bf9f12a)
1*acfbe9e1SPatrick Beard// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
2a0ff0c34SDouglas Gregor
3a0ff0c34SDouglas Gregor// PR9495
4a0ff0c34SDouglas Gregorstruct NonPOD { NonPOD(); ~NonPOD(); };
5a0ff0c34SDouglas Gregor
6a0ff0c34SDouglas Gregor@interface A
7a0ff0c34SDouglas Gregor@end
8a0ff0c34SDouglas Gregor
9a0ff0c34SDouglas Gregor@implementation A
10a0ff0c34SDouglas Gregor- (void)method:(bool)b {
11a0ff0c34SDouglas Gregor  NonPOD np;
12a0ff0c34SDouglas Gregor  if (b) {
13a0ff0c34SDouglas Gregor    goto undeclared; // expected-error{{use of undeclared label 'undeclared'}}
14a0ff0c34SDouglas Gregor  }
15a0ff0c34SDouglas Gregor}
16a0ff0c34SDouglas Gregor@end
17