<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - clang-tidy bool-pointer-implicit-conversion does not warn about `return pointer_to_bool;`"
   href="https://bugs.llvm.org/show_bug.cgi?id=38060">38060</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-tidy bool-pointer-implicit-conversion does not warn about `return pointer_to_bool;`
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>cpeterson@mozilla.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>clang-tidy logs only one bool-pointer-implicit-conversion warning for following
code:

  bool test(bool* pointer_to_bool)
  {
    if (pointer_to_bool) { // warning, as expected :)
    }

    return pointer_to_bool; // no warning, but why not? :(
  }

The `return pointer_to_bool` statement uses pointer_to_bool in a boolean
expression but doesn't trigger a warning.

clang-tidy --checks="-*,misc-bool-pointer-implicit-conversion"
bool-pointer-implicit-conversion.cpp

bool-pointer-implicit-conversion.cpp:5:7: warning: dubious check of 'bool *'
against 'nullptr', did you mean to dereference it?
[misc-bool-pointer-implicit-conversion]
  if (pointer_to_bool) { // warning
      ^
      *

<a href="https://clang.llvm.org/extra/clang-tidy/checks/bugprone-bool-pointer-implicit-conversion.html">https://clang.llvm.org/extra/clang-tidy/checks/bugprone-bool-pointer-implicit-conversion.html</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>