blob: e16d1aa0ed5b37e8950bcaf9ead02b6fc9ffebe0 [file] [log] [blame]
Ted Kremenek033a07e2011-08-03 23:14:55 +00001// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify %s
Ted Kremenek70b6a832009-05-13 18:16:01 +00002
3// This test case was crashing due to how CFRefCount.cpp resolved the
4// ObjCInterfaceDecl* and ClassName in EvalObjCMessageExpr.
5
6typedef signed char BOOL;
7typedef unsigned int NSUInteger;
8typedef struct _NSZone NSZone;
9@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
10@protocol NSObject - (BOOL)isEqual:(id)object;
11@end @protocol NSCopying - (id)copyWithZone:(NSZone *)zone;
12@end @protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone;
13@end @protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder;
14@end @interface NSObject <NSObject> {
15}
16@end typedef float CGFloat;
17typedef struct _NSPoint {
18}
19NSFastEnumerationState;
20@protocol NSFastEnumeration - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len;
21@end @class NSString;
22@interface NSArray : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration> - (NSUInteger)count;
23@end @interface NSMutableArray : NSArray - (void)addObject:(id)anObject;
24@end typedef unsigned short unichar;
25@interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding> - (NSUInteger)length;
26- (int)intValue;
27@end @interface NSSimpleCString : NSString {
28}
29@end @interface NSConstantString : NSSimpleCString @end extern void *_NSConstantStringClassReference;
30@interface NSDictionary : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration> - (NSUInteger)count;
31@end @interface NSMutableDictionary : NSDictionary - (void)removeObjectForKey:(id)aKey;
32@end typedef struct {
33}
34CMProfileLocation;
35@interface NSResponder : NSObject <NSCoding> {
36}
37@end @class NSAttributedString, NSEvent, NSFont, NSFormatter, NSImage, NSMenu, NSText, NSView;
38@interface NSCell : NSObject <NSCopying, NSCoding> {
39}
40@end extern NSString *NSControlTintDidChangeNotification;
41@interface NSActionCell : NSCell {
42}
43@end @class NSArray, NSDocument, NSWindow;
44@interface NSWindowController : NSResponder <NSCoding> {
45}
46@end @class EBayCategoryType, GSEbayCategory, GBSearchRequest;
47@interface GBCategoryChooserPanelController : NSWindowController {
48 GSEbayCategory *rootCategory;
49}
Fariborz Jahanian8822f7c2010-03-27 19:02:17 +000050- (NSMutableDictionary*)categoryDictionaryForCategoryID:(int)inID inRootTreeCategories:(NSMutableArray*)inRootTreeCategories; // expected-note {{method definition for 'categoryDictionaryForCategoryID:inRootTreeCategories:' not found}}
John McCallf85e1932011-06-15 23:02:42 +000051-(NSString*) categoryID; // expected-note {{method definition for 'categoryID' not found}} expected-note {{using}}
Ted Kremenek70b6a832009-05-13 18:16:01 +000052@end @interface GSEbayCategory : NSObject <NSCoding> {
53}
John McCallf85e1932011-06-15 23:02:42 +000054- (int) categoryID; // expected-note {{also found}}
Ted Kremenek70b6a832009-05-13 18:16:01 +000055- (GSEbayCategory *) parent;
56- (GSEbayCategory*) subcategoryWithID:(int) inID;
Fariborz Jahanian8822f7c2010-03-27 19:02:17 +000057@end @implementation GBCategoryChooserPanelController + (int) chooseCategoryIDFromCategories:(NSArray*) inCategories searchRequest:(GBSearchRequest*)inRequest parentWindow:(NSWindow*) inParent { // expected-warning {{incomplete implementation}}
Mike Stump6581c302009-07-21 18:57:14 +000058 return 0;
Ted Kremenek70b6a832009-05-13 18:16:01 +000059}
60- (void) addCategory:(EBayCategoryType*)inCategory toRootTreeCategory:(NSMutableArray*)inRootTreeCategories {
John McCallf85e1932011-06-15 23:02:42 +000061 GSEbayCategory *category = [rootCategory subcategoryWithID:[[inCategory categoryID] intValue]]; // expected-warning {{multiple methods named 'categoryID' found}}
Fariborz Jahanian63e963c2009-11-16 18:57:01 +000062
Ted Kremenek70b6a832009-05-13 18:16:01 +000063 if (rootCategory != category) {
64 GSEbayCategory *parent = category;
65 while ((((void*)0) != (parent = [parent parent])) && ([parent categoryID] != 0)) {
66 NSMutableDictionary *treeCategoryDict = [self categoryDictionaryForCategoryID:[parent categoryID] inRootTreeCategories:inRootTreeCategories];
67 if (((void*)0) == treeCategoryDict) {
68 }
69 }
70 }
71}
Fariborz Jahanian63e963c2009-11-16 18:57:01 +000072@end