[cfe-commits] r155356 - in /cfe/trunk: lib/Sema/SemaType.cpp test/SemaObjCXX/ivar-construct.mm
Douglas Gregor
dgregor at apple.com
Mon Apr 23 09:42:52 PDT 2012
Author: dgregor
Date: Mon Apr 23 11:42:52 2012
New Revision: 155356
URL: http://llvm.org/viewvc/llvm-project?rev=155356&view=rev
Log:
Teach RequireCompleteType about multi-dimensional arrays. Fixes
<rdar://problem/11284902>.
Modified:
cfe/trunk/lib/Sema/SemaType.cpp
cfe/trunk/test/SemaObjCXX/ivar-construct.mm
Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=155356&r1=155355&r2=155356&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Mon Apr 23 11:42:52 2012
@@ -4195,7 +4195,8 @@
// class template specialization, or an array with known size of such,
// try to instantiate it.
QualType MaybeTemplate = T;
- if (const ConstantArrayType *Array = Context.getAsConstantArrayType(T))
+ while (const ConstantArrayType *Array
+ = Context.getAsConstantArrayType(MaybeTemplate))
MaybeTemplate = Array->getElementType();
if (const RecordType *Record = MaybeTemplate->getAs<RecordType>()) {
if (ClassTemplateSpecializationDecl *ClassTemplateSpec
Modified: cfe/trunk/test/SemaObjCXX/ivar-construct.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/ivar-construct.mm?rev=155356&r1=155355&r2=155356&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjCXX/ivar-construct.mm (original)
+++ cfe/trunk/test/SemaObjCXX/ivar-construct.mm Mon Apr 23 11:42:52 2012
@@ -27,3 +27,11 @@
@implementation B
@end
+
+// <rdar://problem/11284902>
+template<typename T> struct Incomplete; // expected-note{{declared here}}
+
+ at interface C {
+ Incomplete<int> a[4][4][4]; // expected-error{{implicit instantiation of undefined template 'Incomplete<int>'}}
+}
+ at end
More information about the cfe-commits
mailing list