[llvm-bugs] [Bug 28405] New: Duplicate USR generated for typedefs in template classes

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jul 3 08:16:09 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=28405

            Bug ID: 28405
           Summary: Duplicate USR generated for typedefs in template
                    classes
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: libclang
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dpldobrev at protonmail.com
                CC: klimek at google.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

#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
(http://clang.llvm.org/doxygen/USRGeneration_8cpp_source.html, 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.

-- 
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/20160703/2cdae819/attachment.html>


More information about the llvm-bugs mailing list