xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/stmts.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1// RUN: %clang_cc1 %s -verify -fsyntax-only -fobjc-exceptions
2
3struct some_struct;
4
5@interface NSObject
6@end
7
8// Note: NSException is not declared.
9void f0(id x) {
10  @try {
11  } @catch (NSException *x) { // expected-error {{unknown type name 'NSException'}}
12  } @catch (struct some_struct x) { // expected-error {{@catch parameter is not a pointer to an interface type}}
13  } @catch (int x) { // expected-error {{@catch parameter is not a pointer to an interface type}}
14  } @catch (static NSObject *y) { // expected-error {{@catch parameter cannot have storage specifier 'static'}}
15  } @catch (...) {
16  }
17}
18
19