1 // RUN: %clang_cc1 -fsyntax-only -verify %s 2 3 // -- prvalue of arithmetic 4 5 bool b = !0; 6 7 bool b2 = !1.2; 8 9 bool b3 = !4; 10 11 // -- unscoped enumeration 12 enum { E, F }; 13 14 bool b4 = !E; 15 bool b5 = !F; 16 17 // -- pointer, 18 bool b6 = !&b4; 19 void f(); 20 bool b61 = !&f; 21 22 // -- or pointer to member type can be converted to a prvalue of type bool. 23 struct S { void f() { } }; 24 25 bool b7 = !&S::f; 26 27 28 bool b8 = !S(); //expected-error {{invalid argument type 'S'}} 29 30 namespace PR8181 31 { 32 void f() { } // expected-note{{candidate function}} 33 void f(char) { } // expected-note{{candidate function}} 34 bool b = !&f; //expected-error {{cannot resolve overloaded function 'f' from context}} 35 36 } 37