Home | History | Annotate | Download | only in SemaObjC
      1 // RUN: %clang_cc1 -fsyntax-only -verify -fobjc-exceptions %s
      2 // expected-no-diagnostics
      3 # 1 "<command line>"
      4 # 1 "/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h" 1 3
      5 typedef signed char BOOL;
      6 typedef unsigned int NSUInteger;
      7 typedef struct _NSZone NSZone;
      8 
      9 @class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
     10 
     11 @protocol NSObject
     12 - (BOOL)isEqual:(id)object;
     13 + class;
     14 @end
     15 
     16 @protocol NSCopying 
     17 - (id)copyWithZone:(NSZone *)zone;
     18 @end
     19 
     20 @protocol NSMutableCopying
     21 - (id)mutableCopyWithZone:(NSZone *)zone;
     22 @end
     23 
     24 @protocol NSCoding
     25 - (void)encodeWithCoder:(NSCoder *)aCoder;
     26 @end
     27 
     28 @interface NSObject <NSObject> {}
     29 @end
     30 
     31 typedef struct {} NSFastEnumerationState;
     32 
     33 @protocol NSFastEnumeration 
     34 - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len;
     35 @end
     36 
     37 @interface NSArray : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration>
     38 - (NSUInteger)count;
     39 @end
     40 
     41 @interface NSMutableArray : NSArray
     42 - (void)addObject:(id)anObject;
     43 + (id)arrayWithCapacity:(int)numItems;
     44 @end
     45 
     46 @interface NSBundle : NSObject {}
     47 + (NSBundle *)bundleForClass:(Class)aClass;
     48 - (NSString *)bundlePath;
     49 - (void)setBundlePath:(NSString *)x;
     50 @end
     51 
     52 @interface NSException : NSObject <NSCopying, NSCoding> {}
     53 @end
     54 
     55 @class NSArray, NSDictionary, NSError, NSString, NSURL;
     56 
     57 @interface DTPlugInManager : NSObject
     58 @end
     59 
     60 @implementation DTPlugInManager
     61 + (DTPlugInManager *)defaultPlugInManager {
     62   @try {
     63     NSMutableArray *plugInPaths = [NSMutableArray arrayWithCapacity:100];
     64     NSBundle *frameworkBundle = [NSBundle bundleForClass:[DTPlugInManager class]];
     65     frameworkBundle.bundlePath = 0;
     66     [plugInPaths addObject:frameworkBundle.bundlePath];
     67   }
     68   @catch (NSException *exception) {}
     69 }
     70 @end
     71