<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - alpha.security.ReturnPtrRange false positives on iterator end() and rbegin()"
   href="https://llvm.org/bugs/show_bug.cgi?id=25226">25226</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>alpha.security.ReturnPtrRange false positives on iterator end() and rbegin()
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

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

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Static Analyzer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>kremenek@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>gonzalobg88@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This check produces a false positive on every `end()` member and non-member
function since the whole point of `end()` is to return an iterator to 1 past
the end. rbegin returns an iterator to one before begin, so this will also
probably fail.

The check maybe be modified to warn on:
- returning a pointer that points to 2 past the end, -2 past the beginning or
more since these cases are a mistake (this is obviously a mistake)
- warn only if this pointer is dereferenced somewhere

If the check cannot be modified to warn on these things maybe its existence
should be reconsidered, since the amount of false positives is just too high on
any codebase that uses iterators.</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>