[llvm-bugs] [Bug 38060] New: clang-tidy bool-pointer-implicit-conversion does not warn about `return pointer_to_bool; `

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 4 19:16:06 PDT 2018


            Bug ID: 38060
           Summary: clang-tidy bool-pointer-implicit-conversion does not
                    warn about `return pointer_to_bool;`
           Product: new-bugs
           Version: unspecified
          Hardware: Macintosh
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: cpeterson at mozilla.com
                CC: llvm-bugs at lists.llvm.org

clang-tidy logs only one bool-pointer-implicit-conversion warning for following

  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:5:7: warning: dubious check of 'bool *'
against 'nullptr', did you mean to dereference it?
  if (pointer_to_bool) { // warning


You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180705/0c66d896/attachment.html>

More information about the llvm-bugs mailing list