Fix copy constructor deletion detection with array types.

This fixes PR9910

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131309 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 77d20ae..3f011a5 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -3521,8 +3521,15 @@
       }
     }
 
-    InitializedEntity MemberEntity =
-      InitializedEntity::InitializeMember(*FI, 0);
+    llvm::SmallVector<InitializedEntity, 4> Entities;
+    QualType CurType = FI->getType();
+    Entities.push_back(InitializedEntity::InitializeMember(*FI, 0));
+    while (CurType->isArrayType()) {
+      Entities.push_back(InitializedEntity::InitializeElement(Context, 0, 
+                                                              Entities.back()));
+      CurType = Context.getAsArrayType(CurType)->getElementType();
+    }
+
     InitializationKind Kind = 
       InitializationKind::CreateDirect(SourceLocation(), SourceLocation(),
                                        SourceLocation());
@@ -3536,7 +3543,7 @@
     Expr *Arg = new (Context) OpaqueValueExpr(SourceLocation(), ArgType,
                                               VK_LValue);
    
-    InitializationSequence InitSeq(*this, MemberEntity, Kind, &Arg, 1);
+    InitializationSequence InitSeq(*this, Entities.back(), Kind, &Arg, 1);
 
     if (InitSeq.getKind() == InitializationSequence::FailedSequence)
       return true;