Do not warn with -Wuninitialized when the member is used in a sizeof or address-of...
[clang.git] / test / SemaObjC / ivar-lookup-resolution-builtin.m
blob2e90e8e044257be79392a0464f26383d7aed1651
1 // RUN: %clang_cc1  -fsyntax-only -verify %s
2 // pr5986
4 @interface Test {
5   int index;
7 - (int) index;
8 + (int) ClassMethod;
9 @end
11 @implementation Test
12 - (int) index
14   return index;
16 + (int) ClassMethod
18   return index; // expected-error {{instance variable 'index' accessed in class method}}
20 @end
22 @interface Test1 {
24 - (int) InstMethod;
25 + (int) ClassMethod;
26 @end
28 @implementation Test1
29 - (int) InstMethod
31   return index; // expected-warning {{implicitly declaring C library function 'index'}} \
32                 // expected-note {{please include the header <strings.h> or explicitly provide a declaration for 'index'}} \
33                 // expected-warning {{incompatible pointer to integer conversion returning}}
35 + (int) ClassMethod
37   return index; // expected-warning {{incompatible pointer to integer conversion returning}}
39 @end