Properly report when a struct is anonymous.
<rdar://problem/16071066>
llvm-svn: 201539
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 5ba9c6a..4f30ccf 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -1152,12 +1152,18 @@
// the CXXRecordDecl class since we often don't know from debug information
// if something is struct or a class, so we default to always use the more
// complete definition just in case.
+
+ bool is_anonymous = (!name) || (!name[0]);
+
CXXRecordDecl *decl = CXXRecordDecl::Create (*ast,
(TagDecl::TagKind)kind,
decl_ctx,
SourceLocation(),
SourceLocation(),
- name && name[0] ? &ast->Idents.get(name) : NULL);
+ is_anonymous ? NULL : &ast->Idents.get(name));
+
+ if (is_anonymous)
+ decl->setAnonymousStructOrUnion(true);
if (decl)
{