Do not warn with -Wuninitialized when the member is used in a sizeof or address-of...
[clang.git] / test / SemaObjC / exprs.m
blob13c34e5650de94044e0d93a23e1ba8e9d4987d67
1 // RUN: %clang_cc1 %s -fsyntax-only -fblocks -verify -Wno-unreachable-code
3 // rdar://6597252
4 Class test1(Class X) {
5   return 1 ? X : X;
9 // rdar://6079877
10 void test2() {
11   id str = @"foo" 
12           "bar\0"    // expected-warning {{literal contains NUL character}}
13           @"baz"  " blarg";
14   id str2 = @"foo" 
15             "bar"
16            @"baz"
17            " b\0larg";  // expected-warning {{literal contains NUL character}}
19   
20   if (@encode(int) == "foo") { }  // expected-warning {{result of comparison against @encode is unspecified}}
23 #define MAX(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
24 void (^foo)(int, int) = ^(int x, int y) { int z = MAX(x, y); };
28 // rdar://8445858
29 @class Object;
30 static Object *g;
31 void test3(Object *o) {
32   // this is ok.
33   __sync_bool_compare_and_swap(&g, 0, o);