xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/gcc-cast-ext.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -verify -fms-extensions -Wno-objc-root-class %s
2*f4a2713aSLionel Sambuc@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
3*f4a2713aSLionel Sambuctypedef struct _NSRange { } NSRange;
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambuc@class PBXFileReference;
6*f4a2713aSLionel Sambuc
7*f4a2713aSLionel Sambuc@interface PBXDocBookmark
8*f4a2713aSLionel Sambuc+ alloc;	// expected-note {{method 'alloc' declared here}}
9*f4a2713aSLionel Sambuc- autorelease;	// expected-note {{method 'autorelease' declared here}}
10*f4a2713aSLionel Sambuc@end
11*f4a2713aSLionel Sambuc
12*f4a2713aSLionel Sambuc// GCC allows pointer expressions in integer constant expressions.
13*f4a2713aSLionel Sambucstruct {
14*f4a2713aSLionel Sambuc  char control[((int)(char *)2)];
15*f4a2713aSLionel Sambuc} xx;
16*f4a2713aSLionel Sambuc
17*f4a2713aSLionel Sambuc@implementation PBXDocBookmark // expected-warning {{method definition for 'autorelease' not found}}\
18*f4a2713aSLionel Sambuc                               // expected-warning {{method definition for 'alloc' not found}}
19*f4a2713aSLionel Sambuc
20*f4a2713aSLionel Sambuc+ (id)bookmarkWithFileReference:(PBXFileReference *)fileRef gylphRange:(NSRange)range anchor:(NSString *)htmlAnchor
21*f4a2713aSLionel Sambuc{
22*f4a2713aSLionel Sambuc    NSRange r = (NSRange)range;
23*f4a2713aSLionel Sambuc    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*f4a2713aSLionel Sambuc}
25*f4a2713aSLionel Sambuc@end
26