<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 --- - Incorrect invalidation of iterator when using ranged deque::erase for first element in deque of size 2." href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23767&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=MNs6gVpnzUwC9Eiaht8u98RKK3u7SZEGasu-EY8kaBw&s=q_D64oM8DMtZiZB4apIjNMRLBd2sENqZDQCG70BySZw&e=">23767</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incorrect invalidation of iterator when using ranged deque::erase for first element in deque of size 2.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </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>All Bugs
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu, mclow.lists@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14439" name="attach_14439" title="Short test program illustrating ranged deque::erase bug.">attachment 14439</a> <a href="attachment.cgi?id=14439&action=edit" title="Short test program illustrating ranged deque::erase bug.">[details]</a></span>
Short test program illustrating ranged deque::erase bug.

According to the standard, all iterators and references are invalidated, unless
the erased elements are at the end or the beginning of the container, in which
case only the iterators and references to the erased elements are invalidated.

In the case of deque of size 2, if you used ranged erase for remove the first
element. Any iterators to the last element will no longer be valid.

See attached example program.</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>