1 // Test for "contextually converted to bool"
2 // { dg-options "-std=c++0x" }
6 explicit operator bool();
29 // These contexts use an explicit bool conversion.
43 switch (a); // { dg-error "" }
44 bool b = a; // { dg-error "" }
45 f(a); // { dg-error "" }
46 B b2 = { a }; // { dg-error "" }
47 a + true; // { dg-message "" }
48 b ? a : true; // { dg-message "" }
49 a ? a : true; // { dg-message "" }