Fix PR4027 + rdar://6808859, we were rejecting implicit casts of
aggregates even though we already accept explicit ones.  Easy fix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69661 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 46dce59..970d295 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -1064,6 +1064,7 @@
       return Exp->getSubExpr()->isConstantInitializer(Ctx);
     break;
   }
+  case ImplicitCastExprClass:
   case CStyleCastExprClass:
     // Handle casts with a destination that's a struct or union; this
     // deals with both the gcc no-op struct cast extension and the
diff --git a/test/Sema/const-eval.c b/test/Sema/const-eval.c
index dd91c48..08daa5f 100644
--- a/test/Sema/const-eval.c
+++ b/test/Sema/const-eval.c
@@ -55,3 +55,9 @@
 EVAL_EXPR(27, (_Complex int)0 ? -1 : 1)
 EVAL_EXPR(28, (_Complex double)1 ? 1 : -1)
 EVAL_EXPR(29, (_Complex int)1 ? 1 : -1)
+
+
+// PR4027 + rdar://6808859
+struct a { int x, y };
+static struct a V2 = (struct a)(struct a){ 1, 2};
+static const struct a V1 = (struct a){ 1, 2};