Anders Carlsson | e9b801f | 2011-02-22 01:52:06 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -verify -fsyntax-only -fobjc-exceptions |
Steve Naroff | 93a2595 | 2009-04-07 22:56:58 +0000 | [diff] [blame] | 2 | |
Chris Lattner | aec2002 | 2009-04-12 23:29:27 +0000 | [diff] [blame] | 3 | struct some_struct; |
| 4 | |
Douglas Gregor | 160b563 | 2010-04-26 17:32:49 +0000 | [diff] [blame] | 5 | @interface NSObject |
| 6 | @end |
| 7 | |
Steve Naroff | 93a2595 | 2009-04-07 22:56:58 +0000 | [diff] [blame] | 8 | // Note: NSException is not declared. |
| 9 | void f0(id x) { |
| 10 | @try { |
Chris Lattner | aec2002 | 2009-04-12 23:29:27 +0000 | [diff] [blame] | 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}} |
Douglas Gregor | 160b563 | 2010-04-26 17:32:49 +0000 | [diff] [blame] | 14 | } @catch (static NSObject *y) { // expected-error {{@catch parameter cannot have storage specifier 'static'}} |
Chris Lattner | aec2002 | 2009-04-12 23:29:27 +0000 | [diff] [blame] | 15 | } @catch (...) { |
Steve Naroff | 93a2595 | 2009-04-07 22:56:58 +0000 | [diff] [blame] | 16 | } |
| 17 | } |
| 18 | |