blob: 5858393b412d3ce1b7434fe6865d0400f67fb291 [file] [log] [blame]
Patrick Beardacfbe9e2012-04-06 18:12:22 +00001// RUN: %clang_cc1 -verify -fms-extensions -Wno-objc-root-class %s
Steve Naroff0b225da2008-06-03 13:21:30 +00002@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
3typedef struct _NSRange { } NSRange;
4
5@class PBXFileReference;
6
7@interface PBXDocBookmark
Ted Kremenek65d63572013-03-27 00:02:21 +00008+ alloc; // expected-note {{method 'alloc' declared here}}
9- autorelease; // expected-note {{method 'autorelease' declared here}}
Steve Naroff0b225da2008-06-03 13:21:30 +000010@end
Steve Naroffaaf51082008-06-03 17:15:29 +000011
12// GCC allows pointer expressions in integer constant expressions.
13struct {
14 char control[((int)(char *)2)];
15} xx;
16
Ted Kremenek65d63572013-03-27 00:02:21 +000017@implementation PBXDocBookmark // expected-warning {{method definition for 'autorelease' not found}}\
18 // expected-warning {{method definition for 'alloc' not found}}
Steve Naroff0b225da2008-06-03 13:21:30 +000019
20+ (id)bookmarkWithFileReference:(PBXFileReference *)fileRef gylphRange:(NSRange)range anchor:(NSString *)htmlAnchor
21{
22 NSRange r = (NSRange)range;
23 return [[[self alloc] initWithFileReference:fileRef gylphRange:(NSRange)range anchor:(NSString *)htmlAnchor] autorelease]; // expected-warning {{method '-initWithFileReference:gylphRange:anchor:' not found (return type defaults to 'id')}}
24}
25@end