1 // RUN: %clang_cc1 -fsyntax-only -verify %s
4 void do_something(int);
11 do_something(X); // expected-warning{{'X' is always zero in this context}}
21 do_something(Y); // expected-warning{{'Y' is always zero in this context}}
25 if (bool B2 = B) { // expected-warning{{'B' is always false in this context}}
26 do_something(B); // expected-warning{{'B' is always false in this context}}
27 } else if (B2) { // expected-warning{{'B2' is always false in this context}}
28 do_something(B); // expected-warning{{'B' is always false in this context}}
29 do_something(B2); // expected-warning{{'B2' is always false in this context}}
31 return B; // expected-warning{{'B' is always false in this context}}
36 if (int *P1 = get_ptr())
38 else if (int *P2 = get_ptr()) {
39 do_something(*P1); // expected-warning{{'P1' is always NULL in this context}}
42 do_something(*P1); // expected-warning{{'P1' is always NULL in this context}}
43 do_something(*P2); // expected-warning{{'P2' is always NULL in this context}}