blob: d452db8c8b2cf58c8f686802baeeb32f654c3245 [file] [log] [blame]
Anders Carlssone9b801f2011-02-22 01:52:06 +00001// RUN: %clang_cc1 %s -verify -fsyntax-only -fobjc-exceptions
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