In Sema::MaybeBindToTemporary, create a CXXBindTemporaryExpr for an
array of objects with non-trivial destructors.  PR11365.

llvm-svn: 145203
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 7b5c358..973e92d 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -4116,7 +4116,8 @@
   if (!getLangOptions().CPlusPlus)
     return Owned(E);
 
-  const RecordType *RT = E->getType()->getAs<RecordType>();
+  QualType ET = Context.getBaseElementType(E->getType());
+  const RecordType *RT = ET->getAs<RecordType>();
   if (!RT)
     return Owned(E);