Commit 2bd85730 authored by Bill Wendling's avatar Bill Wendling
Browse files

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
parent c5606e3e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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
+8 −0
Original line number Diff line number Diff line
@@ -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