1// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core -analyzer-store=region -Wno-incomplete-implementation -verify %s
2
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}
50- (NSMutableDictionary*)categoryDictionaryForCategoryID:(int)inID inRootTreeCategories:(NSMutableArray*)inRootTreeCategories;
51-(NSString*) categoryID; // expected-note {{using}}
52@end @interface GSEbayCategory : NSObject <NSCoding> {
53}
54- (int) categoryID; // expected-note {{also found}}
55- (GSEbayCategory *) parent;
56- (GSEbayCategory*) subcategoryWithID:(int) inID;
57@end   @implementation GBCategoryChooserPanelController  + (int) chooseCategoryIDFromCategories:(NSArray*) inCategories        searchRequest:(GBSearchRequest*)inRequest         parentWindow:(NSWindow*) inParent {
58  return 0;
59}
60- (void) addCategory:(EBayCategoryType*)inCategory toRootTreeCategory:(NSMutableArray*)inRootTreeCategories {
61  GSEbayCategory *category = [rootCategory subcategoryWithID:[[inCategory categoryID] intValue]]; // expected-warning {{multiple methods named 'categoryID' found}}
62
63  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}
72@end
73