<html>
    <head>
      <base href="http://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 --- - [ParentMap - setParent] invalid description"
   href="http://llvm.org/bugs/show_bug.cgi?id=19476">19476</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[ParentMap - setParent] invalid description
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.4
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>Documentation
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre><a href="http://clang.llvm.org/doxygen/classclang_1_1ParentMap.html">http://clang.llvm.org/doxygen/classclang_1_1ParentMap.html</a>

"ParentMap documentation specifies:

void ParentMap::setParent(const Stmt *     S, const Stmt * Parent):

Manually sets the parent of S to Parent.

If S is already in the map, this method will update the mapping."    


It is wrong, because ParentMap uses llvm::DenseMap<Stmt*, Stmt*> and operation

map->insert(std::make_pair(const_cast<Stmt *>(S), const_cast<Stmt *>(Parent)));

will not update the mapping as its default behaviour is like in STL
(<a href="http://llvm.org/docs/doxygen/html/DenseMap_8h_source.html">http://llvm.org/docs/doxygen/html/DenseMap_8h_source.html</a>).
If the key is already in the map, it returns false and doesn't update the
value.


You could change it to update the mapping or remove the description. IMHO the
first option would be better (my intention was to manipulate this map a
little).

Please share some feedback with me.

Thank you.</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>