Revert r107828 and r107827, the fix for PR7556, which seems to be
breaking bootstrap on Linux.

llvm-svn: 107837
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 180b591..021b4af 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -460,7 +460,7 @@
 
   MarkDeclarationReferenced(E->getExprLoc(), Destructor);
   CheckDestructorAccess(E->getExprLoc(), Destructor,
-                        PDiag(diag::err_access_dtor_exception) << Ty);
+                        PDiag(diag::err_access_dtor_temp) << Ty);
   return false;
 }
 
@@ -546,19 +546,27 @@
                                                      RParenLoc));
   }
 
-  if (Ty->isRecordType()) {
-    InitializedEntity Entity = InitializedEntity::InitializeTemporary(Ty);
-    InitializationKind Kind
-      = NumExprs ? InitializationKind::CreateDirect(TypeRange.getBegin(), 
-                                                    LParenLoc, RParenLoc)
-                 : InitializationKind::CreateValue(TypeRange.getBegin(), 
-                                                   LParenLoc, RParenLoc);
-    InitializationSequence InitSeq(*this, Entity, Kind, Exprs, NumExprs);
-    OwningExprResult Result = InitSeq.Perform(*this, Entity, Kind,
-                                              move(exprs));
+  if (const RecordType *RT = Ty->getAs<RecordType>()) {
+    CXXRecordDecl *Record = cast<CXXRecordDecl>(RT->getDecl());
 
-    // FIXME: Improve AST representation?
-    return move(Result);
+    if (NumExprs > 1 || !Record->hasTrivialConstructor() ||
+        !Record->hasTrivialDestructor()) {
+      InitializedEntity Entity = InitializedEntity::InitializeTemporary(Ty);
+      InitializationKind Kind
+        = NumExprs ? InitializationKind::CreateDirect(TypeRange.getBegin(), 
+                                                      LParenLoc, RParenLoc)
+                   : InitializationKind::CreateValue(TypeRange.getBegin(), 
+                                                     LParenLoc, RParenLoc);
+      InitializationSequence InitSeq(*this, Entity, Kind, Exprs, NumExprs);
+      OwningExprResult Result = InitSeq.Perform(*this, Entity, Kind,
+                                                move(exprs));
+
+      // FIXME: Improve AST representation?
+      return move(Result);
+    }
+
+    // Fall through to value-initialize an object of class type that
+    // doesn't have a user-declared default constructor.
   }
 
   // C++ [expr.type.conv]p1:
@@ -577,7 +585,7 @@
   // rvalue of the specified type, which is value-initialized.
   //
   exprs.release();
-  return Owned(new (Context) CXXScalarValueInitExpr(Ty, TyBeginLoc, RParenLoc));
+  return Owned(new (Context) CXXZeroInitValueExpr(Ty, TyBeginLoc, RParenLoc));
 }
 
 
@@ -1984,7 +1992,7 @@
                       BasePath);
   }
 
-  if (isa<CXXScalarValueInitExpr>(rex->IgnoreParens())) {
+  if (isa<CXXZeroInitValueExpr>(rex->IgnoreParens())) {
     // Diagnose use of pointer-to-member type which when used as
     // the functional cast in a pointer-to-member expression.
     Diag(Loc, diag::err_pointer_to_member_type) << isIndirect;