[mlir][inline] Fix Issue#82401: Infinite loop in MLIR inliner for indirect recursive...
[llvm-project.git] / clang / test / CXX / expr / expr.unary / expr.unary.op / p6.cpp
blob833a4014e86869a8b461a4350ef363454714fadd
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 // -- prvalue of arithmetic
5 bool b = !0;
7 bool b2 = !1.2; //expected-warning{{implicit conversion from 'double' to 'bool' changes value from 1.2 to true}}
9 bool b3 = !4;
11 // -- unscoped enumeration
12 enum { E, F };
14 bool b4 = !E;
15 bool b5 = !F;
17 // -- pointer,
18 bool b6 = !&b4; // expected-warning{{address of 'b4' will always evaluate to 'true'}}
19 void f();
20 bool b61 = !&f;
22 // -- or pointer to member type can be converted to a prvalue of type bool.
23 struct S { void f() { } };
25 bool b7 = !&S::f;
28 bool b8 = !S(); //expected-error {{invalid argument type 'S'}}
30 namespace PR8181
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?}}