blob: d1e2ad3612e008466ba3e6db5a94ecea9bef1218 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 %s -verify -fsyntax-only
Steve Naroff93a25952009-04-07 22:56:58 +00002
Chris Lattneraec20022009-04-12 23:29:27 +00003struct some_struct;
4
Douglas Gregor160b5632010-04-26 17:32:49 +00005@interface NSObject
6@end
7
Steve Naroff93a25952009-04-07 22:56:58 +00008// Note: NSException is not declared.
9void f0(id x) {
10 @try {
Chris Lattneraec20022009-04-12 23:29:27 +000011 } @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}}
Douglas Gregor160b5632010-04-26 17:32:49 +000014 } @catch (static NSObject *y) { // expected-error {{@catch parameter cannot have storage specifier 'static'}}
Chris Lattneraec20022009-04-12 23:29:27 +000015 } @catch (...) {
Steve Naroff93a25952009-04-07 22:56:58 +000016 }
17}
18