aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp2
-rw-r--r--test/CodeGenCXX/debug-info-template.cpp14
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index c7a50efcd8..cf147502c5 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -1226,7 +1226,7 @@ llvm::DIType CGDebugInfo::CreateType(const ArrayType *Ty,
} else if (Ty->isIncompleteArrayType()) {
Size = 0;
Align = CGM.getContext().getTypeAlign(Ty->getElementType());
- } else if (Ty->isDependentSizedArrayType()) {
+ } else if (Ty->isDependentSizedArrayType() || Ty->isIncompleteType()) {
Size = 0;
Align = 0;
} else if (Ty->getElementType()->getTypeClass()
diff --git a/test/CodeGenCXX/debug-info-template.cpp b/test/CodeGenCXX/debug-info-template.cpp
index 8560c5a8e9..9d52159bed 100644
--- a/test/CodeGenCXX/debug-info-template.cpp
+++ b/test/CodeGenCXX/debug-info-template.cpp
@@ -30,3 +30,17 @@ struct Test {
};
static Test test;
+// PR9608
+template <int i> struct TheTemplate {
+ struct Empty2 {};
+ typedef const Empty2 DependentType[i];
+ TheTemplate() {}
+};
+
+class TheTemplateTest : public TheTemplate<42> {
+ TheTemplateTest();
+ void method(const TheTemplate<42>::DependentType *) {}
+};
+
+TheTemplateTest::TheTemplateTest() : TheTemplate<42>() {}
+