1 // RUN: %clang_cc1 -fsyntax-only -verify -fobjc-exceptions %s
2 typedef signed char BOOL;
3 typedef struct _NSZone NSZone;
5 @class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
8 - (BOOL)isEqual:(id)object;
12 - (id)copyWithZone:(NSZone *)zone;
16 - (void)encodeWithCoder:(NSCoder *)aCoder;
19 @interface NSObject <NSObject> {}
22 @class NSData, NSArray, NSDictionary, NSCharacterSet, NSData, NSURL, NSError, NSLocale;
24 @interface NSException : NSObject <NSCopying, NSCoding> {}
27 @class ASTNode, XCRefactoringParser, Transform, TransformInstance, XCRefactoringSelectionInfo;
29 @interface XCRefactoringTransformation : NSObject {}
32 @implementation XCRefactoringTransformation
33 - (NSDictionary *)setUpInfoForTransformKey:(NSString *)transformKey outError:(NSError **)outError {
35 // the exception name is optional (weird)
36 @catch (NSException *) {}
37 } // expected-warning {{non-void function does not return a value}}
39 - (NSDictionary *)anotherFunction {
42 } // FIXME: This should warn about a missing return too.
46 struct s { int a, b; } agg, *pagg;
48 @throw 42; // expected-error {{@throw requires an Objective-C object type ('int' invalid)}}
49 @throw agg; // expected-error {{@throw requires an Objective-C object type ('struct s' invalid)}}
50 @throw pagg; // expected-error {{@throw requires an Objective-C object type ('struct s *' invalid)}}
51 @throw; // expected-error {{@throw (rethrow) used outside of a @catch block}}