http://llvm.org/bugs/show_bug.cgi?id=20845

            Bug ID: 20845
           Summary: TypedefDecl pointer from TypedefType can point to
                    uninstantiated template typedef
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Consider the following code: 


template<typename T> class Test
{
        typedef int size_type;

        void function(size_type value) {}
};

Test<int> instance;

When traversing the ast, I look at the CXXMethodDecl for
Test<int>::function(...), I do the following: 

auto param= decl->parameters()[0];
auto paramtype = param->getType();
TypedefType* td = paramtype.getTypePtr()->getAs<TypedefType>();
TypedefDecl* tddecl = td->getDecl();

The problem is that tddecl points to the TypedefDecl within the context of
ClassTemplateTecl and not the specific TypedefDecl of the
ClasstemplateSpecializationDecl. In case the typedef is dependent as well, this
problem does not occur. 

This is a problem because I have a clang-based tool where the context of the
TypedefDecl is important.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to