1 // RUN: %clang_cc1 -std=c++1z -verify -Wuninitialized %s 2 3 void testIf() { 4 if (bool b; b) // expected-warning {{uninitialized}} expected-note {{to silence}} 5 ; 6 if (int a, b = 2; a) // expected-warning {{uninitialized}} expected-note {{to silence}} 7 ; 8 int a; 9 if (a = 0; a) {} // OK 10 } 11 12 void testSwitch() { 13 switch (bool b; b) { // expected-warning {{uninitialized}} expected-warning {{boolean value}} expected-note {{to silence}} 14 case 0: 15 break; 16 } 17 switch (int a, b = 7; a) { // expected-warning {{uninitialized}} expected-note {{to silence}} 18 case 0: 19 break; 20 } 21 int c; 22 switch (c = 0; c) { // OK 23 case 0: 24 break; 25 } 26 } 27