Fixed a bug in ClangASTSource where we would return
the target of a typedef when asked for a typedef.
llvm-svn: 184886
diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp
index 31d035d..e7c90b9 100644
--- a/lldb/source/Expression/ClangASTSource.cpp
+++ b/lldb/source/Expression/ClangASTSource.cpp
@@ -1818,7 +1818,15 @@
{
QualType qual_type = QualType::getFromOpaquePtr(type);
- if (const TagType *tag_type = qual_type->getAs<TagType>())
+ if (const TypedefType *typedef_type = llvm::dyn_cast<TypedefType>(qual_type))
+ {
+ TypedefNameDecl *typedef_name_decl = typedef_type->getDecl();
+
+ m_decls.push_back(typedef_name_decl);
+
+ return (NamedDecl*)typedef_name_decl;
+ }
+ else if (const TagType *tag_type = qual_type->getAs<TagType>())
{
TagDecl *tag_decl = tag_type->getDecl();
@@ -1834,14 +1842,6 @@
return (NamedDecl*)interface_decl;
}
- else if (const TypedefType *typedef_type = qual_type->getAs<TypedefType>())
- {
- TypedefNameDecl *typedef_name_decl = typedef_type->getDecl();
-
- m_decls.push_back(typedef_name_decl);
-
- return (NamedDecl*)typedef_name_decl;
- }
}
return NULL;
}