p6.cpp revision be0ee875d8a91c031a085cbbd73ad9e8dc1aa8ff
1// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3// -- prvalue of arithmetic
4
5bool b = !0;
6
7bool b2 = !1.2; //expected-warning{{implicit conversion from 'double' to 'bool' changes value from 1.2 to true}}
8
9bool b3 = !4;
10
11// -- unscoped enumeration
12enum { E, F };
13
14bool b4 = !E;
15bool b5 = !F;
16
17// --  pointer,
18bool b6 = !&b4;
19void f();
20bool b61 = !&f;
21
22// -- or pointer to member type can be converted to a prvalue of type bool.
23struct S { void f() { } };
24
25bool b7 = !&S::f;
26
27
28bool b8 = !S(); //expected-error {{invalid argument type 'S'}}
29
30namespace PR8181
31{
32  bool f() { } // expected-note{{possible target for call}}
33  void f(char) { } // expected-note{{possible target for call}}
34  bool b = !&f;  //expected-error {{reference to overloaded function could not be resolved; did you mean to call it with no arguments?}}
35}
36