]> granicus.if.org Git - clang/commitdiff
Do not try calculate the size of forward-declared template type array.
authorDevang Patel <dpatel@apple.com>
Fri, 1 Apr 2011 19:02:33 +0000 (19:02 +0000)
committerDevang Patel <dpatel@apple.com>
Fri, 1 Apr 2011 19:02:33 +0000 (19:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128725 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
test/CodeGenCXX/debug-info-template.cpp

index 80bec0f0eebebd612666c74d54720492748755a0..c7a50efcd8bf4d807ed3617db6542f3632cca133 100644 (file)
@@ -1226,6 +1226,14 @@ llvm::DIType CGDebugInfo::CreateType(const ArrayType *Ty,
   } else if (Ty->isIncompleteArrayType()) {
     Size = 0;
     Align = CGM.getContext().getTypeAlign(Ty->getElementType());
+  } else if (Ty->isDependentSizedArrayType()) {
+    Size = 0;
+    Align = 0;
+  } else if (Ty->getElementType()->getTypeClass() 
+             == Type::TemplateSpecialization) {
+    // FIXME : Emit appropriate element type info.
+    Size = 0;
+    Align = 0;
   } else {
     // Size and align of the whole array, not the element type.
     Size = CGM.getContext().getTypeSize(Ty);
index 0ddfc242b10e35bf6158e0d1c6c6c7d1166eebf7..8560c5a8e9bcb92ca99b2ec0bb13a230c01111fd 100644 (file)
@@ -20,3 +20,13 @@ class TU {
 };
 
 TU<2> u2;
+
+// PR9600
+template<typename T> class vector {};
+class Foo;
+typedef vector<Foo*> FooVector[3];
+struct Test {
+  virtual void foo(FooVector *);
+};
+static Test test;
+