summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Symbol/ClangASTType.cpp2
-rw-r--r--lldb/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py3
-rw-r--r--lldb/test/functionalities/data-formatter/typedef_array/main.cpp14
3 files changed, 18 insertions, 1 deletions
diff --git a/lldb/source/Symbol/ClangASTType.cpp b/lldb/source/Symbol/ClangASTType.cpp
index d8e053d0940..06de2ad7335 100644
--- a/lldb/source/Symbol/ClangASTType.cpp
+++ b/lldb/source/Symbol/ClangASTType.cpp
@@ -3642,7 +3642,7 @@ ClangASTType::GetChildClangTypeAtIndex (ExecutionContext *exe_ctx,
case clang::Type::IncompleteArray:
if (ignore_array_bounds || idx_is_valid)
{
- const clang::ArrayType *array = llvm::cast<clang::ArrayType>(parent_qual_type.getTypePtr());
+ const clang::ArrayType *array = GetQualType()->getAsArrayTypeUnsafe();
if (array)
{
ClangASTType element_type (m_ast, array->getElementType());
diff --git a/lldb/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py b/lldb/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py
new file mode 100644
index 00000000000..a70d2ca7414
--- /dev/null
+++ b/lldb/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py
@@ -0,0 +1,3 @@
+import lldbinline
+
+lldbinline.MakeInlineTest(__file__, globals())
diff --git a/lldb/test/functionalities/data-formatter/typedef_array/main.cpp b/lldb/test/functionalities/data-formatter/typedef_array/main.cpp
new file mode 100644
index 00000000000..649c1e09a6a
--- /dev/null
+++ b/lldb/test/functionalities/data-formatter/typedef_array/main.cpp
@@ -0,0 +1,14 @@
+//===-- main.cpp --------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+typedef int Foo;
+
+int main() {
+ Foo array[3] = {1,2,3};
+ return 0; //% self.expect("frame variable array --show-types --", substrs = ['(Foo [3]) array = {','(Foo) [0] = 1','(Foo) [1] = 2','(Foo) [2] = 3'])
+}
OpenPOWER on IntegriCloud