diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-05-12 00:25:32 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-05-12 00:25:32 +0000 |
commit | 2bd857302e3035e85fd6a6eec463837ded030982 (patch) | |
tree | ad1087c1cce638a8c90c64e8e0269b5137a12cee | |
parent | c5606e3ec92c3aa525d46638bc92b0a7c2b442e5 (diff) | |
download | llvm-2bd857302e3035e85fd6a6eec463837ded030982.zip llvm-2bd857302e3035e85fd6a6eec463837ded030982.tar.gz llvm-2bd857302e3035e85fd6a6eec463837ded030982.tar.bz2 |
Merging r155356:
------------------------------------------------------------------------
r155356 | dgregor | 2012-04-23 09:42:52 -0700 (Mon, 23 Apr 2012) | 3 lines
Teach RequireCompleteType about multi-dimensional arrays. Fixes
<rdar://problem/11284902>.
------------------------------------------------------------------------
llvm-svn: 156677
-rw-r--r-- | clang/lib/Sema/SemaType.cpp | 3 | ||||
-rw-r--r-- | clang/test/SemaObjCXX/ivar-construct.mm | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index d0906ded..1b95f05 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -4195,7 +4195,8 @@ bool Sema::RequireCompleteType(SourceLocation Loc, QualType T, // 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 diff --git a/clang/test/SemaObjCXX/ivar-construct.mm b/clang/test/SemaObjCXX/ivar-construct.mm index 535d2a02..a066fca 100644 --- a/clang/test/SemaObjCXX/ivar-construct.mm +++ b/clang/test/SemaObjCXX/ivar-construct.mm @@ -27,3 +27,11 @@ struct Z; // expected-note{{forward declaration}} @implementation B @end + +// <rdar://problem/11284902> +template<typename T> struct Incomplete; // expected-note{{declared here}} + +@interface C { + Incomplete<int> a[4][4][4]; // expected-error{{implicit instantiation of undefined template 'Incomplete<int>'}} +} +@end |