2011-02-22 09:52:06 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -fobjc-exceptions %s
|
2008-06-03 13:36:54 +08:00
|
|
|
typedef signed char BOOL;
|
|
|
|
typedef struct _NSZone NSZone;
|
|
|
|
|
|
|
|
@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
|
|
|
|
|
|
|
|
@protocol NSObject
|
|
|
|
- (BOOL)isEqual:(id)object;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@protocol NSCopying
|
|
|
|
- (id)copyWithZone:(NSZone *)zone;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@protocol NSCoding
|
|
|
|
- (void)encodeWithCoder:(NSCoder *)aCoder;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface NSObject <NSObject> {}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@class NSData, NSArray, NSDictionary, NSCharacterSet, NSData, NSURL, NSError, NSLocale;
|
|
|
|
|
|
|
|
@interface NSException : NSObject <NSCopying, NSCoding> {}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@class ASTNode, XCRefactoringParser, Transform, TransformInstance, XCRefactoringSelectionInfo;
|
|
|
|
|
|
|
|
@interface XCRefactoringTransformation : NSObject {}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation XCRefactoringTransformation
|
2009-10-21 00:39:13 +08:00
|
|
|
- (NSDictionary *)setUpInfoForTransformKey:(NSString *)transformKey outError:(NSError **)outError {
|
2008-06-03 13:36:54 +08:00
|
|
|
@try {}
|
|
|
|
// the exception name is optional (weird)
|
|
|
|
@catch (NSException *) {}
|
|
|
|
}
|
2009-02-12 01:45:08 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
int foo() {
|
2009-02-12 23:54:59 +08:00
|
|
|
struct s { int a, b; } agg, *pagg;
|
|
|
|
|
2011-12-15 08:38:15 +08:00
|
|
|
@throw 42; // expected-error {{@throw requires an Objective-C object type ('int' invalid)}}
|
2009-04-21 14:11:25 +08:00
|
|
|
@throw agg; // expected-error {{@throw requires an Objective-C object type ('struct s' invalid)}}
|
|
|
|
@throw pagg; // expected-error {{@throw requires an Objective-C object type ('struct s *' invalid)}}
|
2009-02-12 06:01:48 +08:00
|
|
|
@throw; // expected-error {{@throw (rethrow) used outside of a @catch block}}
|
2009-02-12 01:45:08 +08:00
|
|
|
}
|