<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 --- - Duplicate USR generated for typedefs in template classes"
   href="https://llvm.org/bugs/show_bug.cgi?id=28405">28405</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Duplicate USR generated for typedefs in template classes
          </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>Windows NT
          </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>libclang
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dpldobrev@protonmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>klimek@google.com, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>#include <string>

template <typename T>
class variant
{
private:
    typedef std::aligned_storage<16, 8>::type data_type;

    data_type data;

    variant<int>* specializeTypeAliasTemplate;
};

If the above code is parsed with the Clang API, the USR for "data_type" is the
same for "variant" and "variant<int>". The problem is in
USRGenerator::VisitTypedefDecl
(<a href="http://clang.llvm.org/doxygen/USRGeneration_8cpp_source.html">http://clang.llvm.org/doxygen/USRGeneration_8cpp_source.html</a>, line 511 at the
time of writing). It handles the declaration context just as a NamedDecl which
in the case of a template and one of its specialisations results in the same
string.</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>