Bug 1846030 [wpt PR 41229] - CloseWatcher: factor out and expand Esc key tests, a...
[gecko.git] / tools / clang-tidy / test / bugprone-bool-pointer-implicit-conversion.cpp
blob602fa9a578b4dd597cf06f6dd2a4966d4ec528e9
1 // https://clang.llvm.org/extra/clang-tidy/checks/bugprone-bool-pointer-implicit-conversion.html
3 bool test(bool* pointer_to_bool, int* pointer_to_int)
5 if (pointer_to_bool) { // warning for pointer to bool
8 if (pointer_to_int) { // no warning for pointer to int
11 if (!pointer_to_bool) { // no warning, but why not??
14 if (pointer_to_bool != nullptr) { // no warning for nullptr comparison
17 // no warning on return, but why not??
18 // clang-tidy bug: https://bugs.llvm.org/show_bug.cgi?id=38060
19 return pointer_to_bool;