2011-02-22 09:52:06 +08:00
|
|
|
// RUN: %clang_cc1 %s -verify -fsyntax-only -fobjc-exceptions
|
2009-04-08 06:56:58 +08:00
|
|
|
|
2009-04-13 07:29:27 +08:00
|
|
|
struct some_struct;
|
|
|
|
|
2010-04-27 01:32:49 +08:00
|
|
|
@interface NSObject
|
|
|
|
@end
|
|
|
|
|
2009-04-08 06:56:58 +08:00
|
|
|
// Note: NSException is not declared.
|
|
|
|
void f0(id x) {
|
|
|
|
@try {
|
2009-04-13 07:29:27 +08:00
|
|
|
} @catch (NSException *x) { // expected-error {{unknown type name 'NSException'}}
|
|
|
|
} @catch (struct some_struct x) { // expected-error {{@catch parameter is not a pointer to an interface type}}
|
|
|
|
} @catch (int x) { // expected-error {{@catch parameter is not a pointer to an interface type}}
|
2010-04-27 01:32:49 +08:00
|
|
|
} @catch (static NSObject *y) { // expected-error {{@catch parameter cannot have storage specifier 'static'}}
|
2009-04-13 07:29:27 +08:00
|
|
|
} @catch (...) {
|
2009-04-08 06:56:58 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|